Browse Source

another commit

gradlePlay
Gutyn 9 years ago
parent
commit
506ba1bba8
  1. 4
      .gitignore
  2. 3
      app/app.iml
  3. 8
      app/build.gradle
  4. 14
      app/src/androidTest/java/com/breadwallet/presenter/activities/tests/MainActivityTest.java
  5. 149
      app/src/androidTest/java/com/breadwallet/presenter/currencyformatting/tests/CurrencyFormatterFixedTests.java
  6. 153
      app/src/androidTest/java/com/breadwallet/presenter/currencyformatting/tests/CurrencyFormatterTests.java
  7. 30
      app/src/main/java/com/breadwallet/presenter/BreadWalletApp.java
  8. 81
      app/src/main/java/com/breadwallet/presenter/activities/MainActivity.java
  9. 5
      app/src/main/java/com/breadwallet/presenter/entities/CurrencyEntity.java
  10. 107
      app/src/main/java/com/breadwallet/presenter/fragments/FragmentCurrency.java
  11. 4
      app/src/main/java/com/breadwallet/presenter/fragments/FragmentScanResult.java
  12. 89
      app/src/main/java/com/breadwallet/presenter/fragments/FragmentSettings.java
  13. 6
      app/src/main/java/com/breadwallet/presenter/fragments/MainFragment.java
  14. 18
      app/src/main/java/com/breadwallet/presenter/fragments/MainFragmentDecoder.java
  15. 37
      app/src/main/java/com/breadwallet/presenter/fragments/MainFragmentQR.java
  16. 9
      app/src/main/java/com/breadwallet/presenter/fragments/MainFragmentSettingsAll.java
  17. 63
      app/src/main/java/com/breadwallet/presenter/fragments/SharingFragment.java
  18. 11
      app/src/main/java/com/breadwallet/tools/adapter/CurrencyListAdapter.java
  19. 1
      app/src/main/java/com/breadwallet/tools/adapter/CustomPagerAdapter.java
  20. 2
      app/src/main/java/com/breadwallet/tools/adapter/ParallaxViewPager.java
  21. 208
      app/src/main/java/com/breadwallet/tools/animation/FragmentAnimator.java
  22. 108
      app/src/main/java/com/breadwallet/tools/others/CurrencyManager.java
  23. 35
      app/src/main/res/layouts/activities/layout/activity_main.xml
  24. 4
      app/src/main/res/layouts/fragments/layout/fragment_local_currency.xml
  25. 1
      app/src/main/res/layouts/fragments/layout/fragment_main.xml
  26. 3
      app/src/main/res/layouts/fragments/layout/fragment_scan_result.xml
  27. BIN
      captures/Snapshot_2015.07.15_14.14.21.hprof
  28. BIN
      captures/Snapshot_2015.07.15_14.14.39.hprof
  29. BIN
      captures/Snapshot_2015.07.15_14.27.28.hprof
  30. BIN
      captures/Snapshot_2015.07.15_14.27.43.hprof
  31. BIN
      captures/Snapshot_2015.07.15_14.28.00.hprof

4
.gitignore

@ -26,4 +26,8 @@ proguard/
# Log Files
*.log
# The workspace.xml should be generated individually on different IDE's, thus I will ignore it.
.idea/workspace.xml
# Android Studio Navigation editor temp files
.navigation/

3
app/app.iml

@ -96,14 +96,15 @@
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
<excludeFolder url="file://$MODULE_DIR$/build/reports" />
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
</content>
<orderEntry type="jdk" jdkName="Android API 22 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="support-annotations-22.2.0" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="hamcrest-core-1.3" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="javawriter-2.1.1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="javax.annotation-api-1.2" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="javawriter-2.1.1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="espresso-idling-resource-2.2" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="junit-4.12" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="hamcrest-library-1.3" level="project" />

8
app/build.gradle

@ -29,6 +29,9 @@ android {
}
sourceSets {
main {
// java {
// exclude '**/SomeExcludedClass.java'
// }
manifest.srcFile 'src/main/AndroidManifest.xml'
java.srcDirs = ['src/main/java', '.apt_generated']
aidl.srcDirs = ['src/main/aidl', '.apt_generated']
@ -42,6 +45,11 @@ android {
'src/main/res'
]
}
// androidTest {
// java {
// exclude '**/TestSomeExcludedClass.java'
// }
// }
}
}

14
app/src/androidTest/java/com/breadwallet/presenter/activities/tests/MainActivityTest.java

@ -13,27 +13,26 @@ import static android.support.test.espresso.Espresso.onView;
import static android.support.test.espresso.action.ViewActions.clearText;
import static android.support.test.espresso.action.ViewActions.click;
import static android.support.test.espresso.action.ViewActions.closeSoftKeyboard;
import static android.support.test.espresso.action.ViewActions.pressMenuKey;
import static android.support.test.espresso.action.ViewActions.scrollTo;
import static android.support.test.espresso.action.ViewActions.typeText;
import static android.support.test.espresso.matcher.ViewMatchers.withId;
/**
* BreadWallet
*
* <p/>
* Created by Mihail on 7/7/15.
* Copyright (c) 2015 Mihail Gutan <mihail@breadwallet.com>
*
* <p/>
* 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:
*
* <p/>
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* <p/>
* 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
@ -83,13 +82,12 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv
onView(withId(R.id.addresseditText))
.perform(clearText(), typeText("some testing text"), closeSoftKeyboard());
onView(withId(R.id.mainbuttonscanqrcode)).perform(click());
onView(withId(R.id.pager)).perform(pressMenuKey()).perform(pressMenuKey()).perform(pressMenuKey()).perform(pressMenuKey());
scrollTo();
}
@MediumTest
public void testSettingsClick(){
public void testSettingsClick() {
}
}

149
app/src/androidTest/java/com/breadwallet/presenter/currencyformatting/tests/CurrencyFormatterFixedTests.java

@ -1,28 +1,129 @@
package com.breadwallet.presenter.currencyformatting.tests;
import android.test.AndroidTestCase;
import java.util.Locale;
/**
* BreadWallet
* <p/>
* Created by Mihail on 8/18/15.
* Copyright (c) 2015 Mihail Gutan <mihail@breadwallet.com>
* <p/>
* 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:
* <p/>
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* <p/>
* 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.
* ISO 4217 currency codes can be found here:
* http://en.wikipedia.org/wiki/ISO_4217
*/
public class CurrencyFormatterFixedTests {
}
public class CurrencyFormatterFixedTests extends AndroidTestCase {
/**
* These tests differ between Android <= 4.0, and >= 4.1.
*/
public void testJPY() {
String expected = "¥15";
String actual = CurrencyFormatter.getFormattedCurrencyStringFixed(new Locale("ja", "JP"), "JPY", 15.00);
assertEquals(expected, actual);
// 4.0 and below - Fails. (¥15.00)
// 4.1 and above - Fails (¥15)
// Yes, that is a different yen symbol to what we get with ja_JP locale (note
// we're forcing en_US in the CurrencyFormatter).
}
public void testNZDollarsInJapanLocale() {
// New Zealand currency, but the device locale is ja_JP
String expected = "NZ$16"; // Yen has no decimal units
String actual = CurrencyFormatter.getFormattedCurrencyStringFixed(new Locale("ja", "JP"), "NZD", 15.50);
assertEquals(expected, actual);
// 4.0 and below - Fails (NZ$15.50).
}
public void testCLP() {
String expected = "$15"; // Chilean Peso has no decimal units.
String actual = CurrencyFormatter.getFormattedCurrencyStringFixed(new Locale("es", "CL"), "CLP", 15.00);
assertEquals(expected, actual);
// 4.0 and below - Fails. (CL$ 15,00)
// 4.1 and above - Fails (CLP15).
}
public void testNZDollarsInChileLocale() {
// New Zealand currency, but the device locale is es_CL
String expected = "NZ$16";
String actual = CurrencyFormatter.getFormattedCurrencyStringFixed(new Locale("es", "CL"), "NZD", 15.50);
assertEquals(expected, actual);
// 4.0 and below - Fails. (NZ$15,50)
}
public void testNZDollarsInAustralianLocale() {
String expected = "NZ$15.00";
String actual = CurrencyFormatter.getFormattedCurrencyStringFixed(new Locale("en", "AU"), "NZD", 15.00);
assertEquals(expected, actual);
}
public void testAustralianDollarsInNewZealandLocale() {
String expected = "AU$15.00";
String actual = CurrencyFormatter.getFormattedCurrencyStringFixed(new Locale("en", "NZ"), "AUD", 15.00);
assertEquals(expected, actual);
}
public void testGBP() {
String expected = "£15.00";
String actual = CurrencyFormatter.getFormattedCurrencyStringFixed(new Locale("en", "GB"), "GBP", 15.00);
assertEquals(expected, actual);
}
public void testNZD() {
String expected = "$15.00";
String actual = CurrencyFormatter.getFormattedCurrencyStringFixed(new Locale("en", "NZ"), "NZD", 15.00);
assertEquals(expected, actual);
// Fails - NZ$15.00
}
public void testUSD() {
String expected = "$15.00";
String actual = CurrencyFormatter.getFormattedCurrencyStringFixed(new Locale("en", "US"), "USD", 15.00);
assertEquals(expected, actual);
}
public void testNZDInUSLocale() {
String expected = "NZ$15.00";
String actual = CurrencyFormatter.getFormattedCurrencyStringFixed(new Locale("en", "US"), "NZD", 15.00);
assertEquals(expected, actual);
}
public void testEURInFranceLocale() {
String expected = "15,00 €";
String actual = CurrencyFormatter.getFormattedCurrencyStringFixed(new Locale("fr", "FR"), "EUR", 15.00);
assertEquals(expected, actual);
}
public void testEURInRepublicOfIrelandLocale() {
String expected = "€15.00";
String actual = CurrencyFormatter.getFormattedCurrencyStringFixed(new Locale("en", "IE"), "EUR", 15.00);
assertEquals(expected, actual);
}
public void testUSDollarsInCanadianLocale() {
String expected = "US$15.00";
String actual = CurrencyFormatter.getFormattedCurrencyStringFixed(new Locale("en", "CA"), "USD", 15.00);
assertEquals(expected, actual);
// Fails - $15.00
}
public void testCanadianDollarsInUSLocale() {
String expected = "CA$15.00";
String actual = CurrencyFormatter.getFormattedCurrencyStringFixed(new Locale("en", "US"), "CAD", 15.00);
assertEquals(expected, actual);
}
public void testEurosInUnitedKingdomLocale() {
String expected = "€15.00";
String actual = CurrencyFormatter.getFormattedCurrencyStringFixed(new Locale("en", "GB"), "EUR", 15.00);
assertEquals(expected, actual);
}
public void testPoundsInFranceLocale() {
String expected = "15,00 £UK";
String actual = CurrencyFormatter.getFormattedCurrencyStringFixed(new Locale("fr", "FR"), "GBP", 15.00);
assertEquals(expected, actual);
// Fails - 15,00 £
}
}

153
app/src/androidTest/java/com/breadwallet/presenter/currencyformatting/tests/CurrencyFormatterTests.java

@ -1,28 +1,129 @@
package com.breadwallet.presenter.currencyformatting.tests;
/**
* BreadWallet
* <p/>
* Created by Mihail on 8/18/15.
* Copyright (c) 2015 Mihail Gutan <mihail@breadwallet.com>
* <p/>
* 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:
* <p/>
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* <p/>
* 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.
*/
public class CurrencyFormatterTests {
}
import android.test.AndroidTestCase;
import java.util.Locale;
public class CurrencyFormatterTests extends AndroidTestCase {
/**
* These tests differ between Android <= 4.0, and >= 4.1.
*/
public void testJPY() {
String expected = "¥15";
String actual = CurrencyFormatter.getFormattedCurrencyStringForLocale(new Locale("ja", "JP"), "JPY", 15.00);
assertEquals(expected, actual);
// 4.0 and below - Fails. (¥15.00)
// 4.1 and above - Passes.
}
public void testNZDollarsInJapanLocale() {
// New Zealand currency, but the device locale is ja_JP
String expected = "NZ$16"; // Yen has no decimal units
String actual = CurrencyFormatter.getFormattedCurrencyStringForLocale(new Locale("ja", "JP"), "NZD", 15.50);
assertEquals(expected, actual);
// 4.0 and below - Fails. NZ$15.50.
// 4.1 and above - Passes.
}
public void testCLP() {
String expected = "$15"; // Chilean Peso has no decimal units.
String actual = CurrencyFormatter.getFormattedCurrencyStringForLocale(new Locale("es", "CL"), "CLP", 15.00);
assertEquals(expected, actual);
// 4.0 and below - Fails. (CL$ 15,00)
// 4.1 and above - Passes.
}
public void testNZDollarsInChileLocale() {
// New Zealand currency, but the device locale is es_CL
String expected = "NZ$16";
String actual = CurrencyFormatter.getFormattedCurrencyStringForLocale(new Locale("es", "CL"), "NZD", 15.50);
assertEquals(expected, actual);
// 4.0 and below - Fails. NZD 15,50
// 4.1 and above - Fails. NZD16
}
/**
* These tests fail, presumably because the formatting tables for the provided locales don't
* have a custom currency unit for the supplied ISO currency code.
*/
public void testNZDollarsInAustralianLocale() {
String expected = "NZ$15.00";
String actual = CurrencyFormatter.getFormattedCurrencyStringForLocale(new Locale("en", "AU"), "NZD", 15.00);
assertEquals(expected, actual);
// Fails. NZD15.00
}
public void testAustralianDollarsInNewZealandLocale() {
String expected = "AU$15.00";
String actual = CurrencyFormatter.getFormattedCurrencyStringForLocale(new Locale("en", "NZ"), "AUD", 15.00);
assertEquals(expected, actual);
// Fails. AUD15.00
}
/**
* These tests pass in all cases I've tested. (device version and locale variations)
*/
public void testGBP() {
String expected = "£15.00";
String actual = CurrencyFormatter.getFormattedCurrencyStringForLocale(new Locale("en", "GB"), "GBP", 15.00);
assertEquals(expected, actual);
}
public void testNZD() {
String expected = "$15.00";
String actual = CurrencyFormatter.getFormattedCurrencyStringForLocale(new Locale("en", "NZ"), "NZD", 15.00);
assertEquals(expected, actual);
}
public void testUSD() {
String expected = "$15.00";
String actual = CurrencyFormatter.getFormattedCurrencyStringForLocale(new Locale("en", "US"), "USD", 15.00);
assertEquals(expected, actual);
}
public void testNZDInUSLocale() {
String expected = "NZ$15.00";
String actual = CurrencyFormatter.getFormattedCurrencyStringForLocale(new Locale("en", "US"), "NZD", 15.00);
assertEquals(expected, actual);
}
public void testEURInFranceLocale() {
String expected = "15,00 €";
String actual = CurrencyFormatter.getFormattedCurrencyStringForLocale(new Locale("fr", "FR"), "EUR", 15.00);
assertEquals(expected, actual);
}
public void testEURInRepublicOfIrelandLocale() {
String expected = "€15.00";
String actual = CurrencyFormatter.getFormattedCurrencyStringForLocale(new Locale("en", "IE"), "EUR", 15.00);
assertEquals(expected, actual);
}
public void testUSDollarsInCanadianLocale() {
String expected = "US$15.00";
String actual = CurrencyFormatter.getFormattedCurrencyStringForLocale(new Locale("en", "CA"), "USD", 15.00);
assertEquals(expected, actual);
}
public void testCanadianDollarsInUSLocale() {
String expected = "CA$15.00";
String actual = CurrencyFormatter.getFormattedCurrencyStringForLocale(new Locale("en", "US"), "CAD", 15.00);
assertEquals(expected, actual);
}
public void testEurosInUnitedKingdomLocale() {
String expected = "€15.00";
String actual = CurrencyFormatter.getFormattedCurrencyStringForLocale(new Locale("en", "GB"), "EUR", 15.00);
assertEquals(expected, actual);
}
public void testPoundsInFranceLocale() {
String expected = "15,00 £UK";
String actual = CurrencyFormatter.getFormattedCurrencyStringForLocale(new Locale("fr", "FR"), "GBP", 15.00);
assertEquals(expected, actual);
}
}

30
app/src/main/java/com/breadwallet/presenter/BreadWalletApp.java

@ -5,6 +5,7 @@ import android.app.Application;
import android.content.Context;
import android.graphics.Point;
import android.os.Handler;
import android.util.Log;
import android.view.Display;
import android.view.Gravity;
import android.view.LayoutInflater;
@ -15,6 +16,7 @@ import android.widget.TextView;
import android.widget.Toast;
import com.breadwallet.R;
import com.breadwallet.presenter.activities.MainActivity;
import com.breadwallet.tools.others.TypefaceUtil;
import org.acra.ACRA;
@ -62,6 +64,8 @@ import org.acra.annotation.ReportsCrashes;
resToastText = R.string.crash_toast_text
)
public class BreadWalletApp extends Application {
public static final int BREAD_WALLET_IMAGE = 0;
public static final int SETTINGS_TEXT = 1;
public static final String TAG = "BreadWalletApp";
private boolean customToastAvailable = true;
private String oldMessage;
@ -80,6 +84,7 @@ public class BreadWalletApp extends Application {
DISPLAY_HEIGHT_PX = size.y;
ACRA.init(this);
TypefaceUtil.overrideFont(getApplicationContext(), "DEFAULT", "fonts/Roboto-Light.ttf");
}
/**
@ -111,6 +116,13 @@ public class BreadWalletApp extends Application {
}
}
public void cancelToast() {
if (toast != null) {
Log.e(TAG, "Toast canceled");
toast.cancel();
}
}
public int getRelativeLeft(View myView) {
if (myView.getParent() == myView.getRootView())
return myView.getLeft();
@ -124,4 +136,22 @@ public class BreadWalletApp extends Application {
else
return myView.getTop() + getRelativeTop((View) myView.getParent());
}
public void setTopMidleView(int view, String text) {
MainActivity app = MainActivity.app;
switch (view) {
case BREAD_WALLET_IMAGE:
if (app.viewFlipper.getDisplayedChild() == 1) {
app.viewFlipper.showPrevious();
}
break;
case SETTINGS_TEXT:
if (app.viewFlipper.getDisplayedChild() == 0) {
app.viewFlipper.showNext();
}
((TextView) app.viewFlipper.getCurrentView()).setText(text);
break;
}
}
}

81
app/src/main/java/com/breadwallet/presenter/activities/MainActivity.java

@ -14,6 +14,7 @@ import android.widget.Button;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.Toast;
import android.widget.ViewFlipper;
import com.breadwallet.R;
import com.breadwallet.presenter.BreadWalletApp;
@ -69,6 +70,7 @@ public class MainActivity extends FragmentActivity {
public static RelativeLayout pageIndicator;
public ImageView pageIndicatorLeft;
public ImageView pageIndicatorRight;
public View middleView;
public Map<String, Integer> burgerButtonMap;
public Button burgerButton;
public Button locker;
@ -83,13 +85,13 @@ public class MainActivity extends FragmentActivity {
public FragmentWipeWallet fragmentWipeWallet;
public RelativeLayout burgerButtonLayout;
public FragmentScanResult fragmentScanResult;
private boolean onBackPressedAvailable = true;
private boolean doubleBackToExitPressedOnce;
public static final int BURGER = 0;
public static final int CLOSE = 1;
public static final int BACK = 2;
public static final float PAGE_INDICATOR_SCALE_UP = 1.3f;
public static boolean beenThroughSavedInstanceMethod = false;
public ViewFlipper viewFlipper;
/**
* Public constructor used to assign the current instance to the app variable
@ -119,12 +121,15 @@ public class MainActivity extends FragmentActivity {
@Override
public void onClick(View v) {
SpringAnimator.showAnimation(burgerButton);
if (FragmentAnimator.level > 1 || scanResultFragmentOn) {
if (FragmentAnimator.level > 1 || scanResultFragmentOn || decoderFragmentOn) {
Log.e(TAG, "CHECK:Should press back!");
app.onBackPressed();
} else {
FragmentAnimator.pressMenuButton(app, mainFragmentSettingsAll);
Log.e(TAG, "CHECK:Should press menu");
//check availability here, because method onBackPressed does the checking as well.
if (FragmentAnimator.checkTheMultipressingAvailability(300)) {
FragmentAnimator.pressMenuButton(app, mainFragmentSettingsAll);
Log.e(TAG, "CHECK:Should press menu");
}
}
}
});
@ -135,6 +140,7 @@ public class MainActivity extends FragmentActivity {
protected void onResume() {
super.onResume();
CurrencyManager.startTimer();
}
@Override
@ -158,10 +164,11 @@ public class MainActivity extends FragmentActivity {
private void initializeViews() {
burgerButtonLayout = (RelativeLayout) findViewById(R.id.burgerbuttonlayout);
burgerButton = (Button) findViewById(R.id.mainbuttonburger);
viewFlipper = (ViewFlipper) MainActivity.app.findViewById(R.id.middle_view_flipper);
locker = (Button) findViewById(R.id.mainbuttonlocker);
pageIndicator = (RelativeLayout) findViewById(R.id.pager_indicator);
pageIndicatorLeft = (ImageView) findViewById(R.id.circle_indicator_left);
middleView = findViewById(R.id.maintextbreadwallet);
pageIndicatorRight = (ImageView) findViewById(R.id.circle_indicator_right);
pagerAdapter = new CustomPagerAdapter(getSupportFragmentManager());
burgerButtonMap = new HashMap<>();
@ -188,15 +195,11 @@ public class MainActivity extends FragmentActivity {
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_MENU) {
if (FragmentAnimator.level > 1) {
if (FragmentAnimator.level > 1 || scanResultFragmentOn || decoderFragmentOn) {
this.onBackPressed();
} else {
if(scanResultFragmentOn){
app.onBackPressed();
}
} else if (FragmentAnimator.checkTheMultipressingAvailability(300)) {
FragmentAnimator.pressMenuButton(app, mainFragmentSettingsAll);
}
return true;
}
// let the system handle all other key events
return super.onKeyDown(keyCode, event);
@ -204,43 +207,8 @@ public class MainActivity extends FragmentActivity {
@Override
public void onBackPressed() {
Log.e(TAG, "onBackPressed!");
if (onBackPressedAvailable) {
onBackPressedAvailable = false;
makeOnBackPressedAvailable(300);
//old implimentation, keep in case the new ones fail
// if (!FragmentAnimator.wipeWalletOpen) {
// if (FragmentAnimator.level == 0) {
// if (doubleBackToExitPressedOnce) {
// super.onBackPressed();
// return;
// }
// if (decoderFragmentOn) {
// FragmentAnimator.hideDecoderFragment();
// } else {
// this.doubleBackToExitPressedOnce = true;
// ((BreadWalletApp) getApplicationContext()).showCustomToast(this,
// getResources().getString(R.string.mainactivity_press_back_again), 100, Toast.LENGTH_SHORT);
// new Handler().postDelayed(new Runnable() {
// @Override
// public void run() {
// doubleBackToExitPressedOnce = false;
// }
// }, 1000);
// }
// } else if (FragmentAnimator.level == 1) {
// FragmentAnimator.pressMenuButton(this, mainFragmentSettingsAll);
// if (FragmentAnimator.multiplePressingAvailable)
// FragmentAnimator.hideDecoderFragment();
// } else {
// FragmentAnimator.animateSlideToRight(this);
// }
// } else {
// FragmentAnimator.pressWipeWallet(this, fragmentSettings);
// activityButtonsEnable(true);
// }
if (FragmentAnimator.checkTheMultipressingAvailability(300)) {
Log.e(TAG, "onBackPressed!");
if (FragmentAnimator.wipeWalletOpen) {
FragmentAnimator.pressWipeWallet(this, fragmentSettings);
activityButtonsEnable(true);
@ -263,14 +231,14 @@ public class MainActivity extends FragmentActivity {
}
this.doubleBackToExitPressedOnce = true;
((BreadWalletApp) getApplicationContext()).showCustomToast(this,
getResources().getString(R.string.mainactivity_press_back_again), 140, Toast.LENGTH_SHORT);
getResources().getString(R.string.mainactivity_press_back_again), 140,
Toast.LENGTH_SHORT);
makeDoubleBackToExitPressedOnce(1000);
break;
case 1:
FragmentAnimator.pressMenuButton(this, mainFragmentSettingsAll);
if (FragmentAnimator.multiplePressingAvailable)
FragmentAnimator.hideDecoderFragment();
FragmentAnimator.hideDecoderFragment();
break;
default:
FragmentAnimator.animateSlideToRight(this);
@ -284,6 +252,7 @@ public class MainActivity extends FragmentActivity {
*
* @patam x The page for the indicator to be shown
*/
public void setPagerIndicator(int x) {
if (x == 0) {
Log.d(TAG, "Left Indicator changed");
@ -349,15 +318,6 @@ public class MainActivity extends FragmentActivity {
v.startAnimation(anim);
}
private void makeOnBackPressedAvailable(int ms) {
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
onBackPressedAvailable = true;
}
}, ms);
}
private void makeDoubleBackToExitPressedOnce(int ms) {
new Handler().postDelayed(new Runnable() {
@Override
@ -366,4 +326,5 @@ public class MainActivity extends FragmentActivity {
}
}, ms);
}
}

5
app/src/main/java/com/breadwallet/presenter/entities/CurrencyEntity.java

@ -25,4 +25,9 @@ package com.breadwallet.presenter.entities;
* THE SOFTWARE.
*/
public class CurrencyEntity {
public static final String TAG = "CurrencyEntity";
public String codeAndName;
public String name;
public String code;
public double rate;
}

107
app/src/main/java/com/breadwallet/presenter/fragments/FragmentCurrency.java

@ -2,9 +2,9 @@
package com.breadwallet.presenter.fragments;
import android.content.SharedPreferences;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@ -51,14 +51,16 @@ public class FragmentCurrency extends Fragment {
public static final String TAG = "FragmentCurrency";
public static final String CURRENT_CURRENCY = "currentCurrency";
public static final String POSITION = "position";
private ListView currencyList;
private MainActivity app;
private Button currencyRefresh;
private TextView noInternetConnection;
private CurrencyListAdapter adapter;
private TextView currencyItemText;
private ProgressBar currencyProgressBar;
public ListView currencyList;
public MainActivity app;
public Button currencyRefresh;
public TextView noInternetConnection;
public CurrencyListAdapter adapter;
public TextView currencyItemText;
public ProgressBar currencyProgressBar;
SharedPreferences settings;
private String ISO;
int lastItemsPosition = 0;
@Override
public View onCreateView(LayoutInflater inflater,
@ -67,18 +69,61 @@ public class FragmentCurrency extends Fragment {
// properly.
final View rootView = inflater.inflate(
R.layout.fragment_local_currency, container, false);
app = MainActivity.app;
currencyList = (ListView) rootView.findViewById(R.id.currency_list_view);
currencyList.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
currencyProgressBar = (ProgressBar) rootView.findViewById(R.id.currency_progress_barr);
currencyRefresh = (Button) rootView.findViewById(R.id.currencyRefresh);
noInternetConnection = (TextView) rootView.findViewById(R.id.noInternetConnectionText);
app = MainActivity.app;
settings = getActivity().getSharedPreferences(MainActivity.PREFS_NAME, 0);
new ListInitiatorTask().execute();
currencyList.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
final SharedPreferences.Editor editor = settings.edit();
tryAndSetAdapter();
currencyRefresh.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
adapter = CurrencyManager.getCurrencyAddapterIfReady();
tryAndSetAdapter();
}
});
currencyList.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view,
int position, long id) {
adapter.notifyDataSetChanged();
currencyItemText = (TextView) view.findViewById(R.id.currency_item_text);
final String selectedCurrency = currencyItemText.getText().toString();
ISO = selectedCurrency.substring(0, 3);
lastItemsPosition = position;
editor.putString(CURRENT_CURRENCY, ISO);
editor.putInt(POSITION, position);
editor.commit();
((BreadWalletApp) getActivity().getApplication()).setTopMidleView(BreadWalletApp.SETTINGS_TEXT,
CurrencyManager.getTheFinalExchangeString(1.0, adapter.getItem(position).rate, ISO));
}
});
return rootView;
}
@Override
public void onResume() {
super.onResume();
SharedPreferences settings = getActivity().getSharedPreferences(MainActivity.PREFS_NAME, 0);
final String tmp = settings.getString(FragmentCurrency.CURRENT_CURRENCY, "USD");
Log.e(TAG, "Tmp 3 letters: " + tmp);
((BreadWalletApp) getActivity().getApplication()).setTopMidleView(BreadWalletApp.SETTINGS_TEXT,
CurrencyManager.getTheFinalExchangeString(1.0, adapter.getItem(settings.getInt(FragmentCurrency.POSITION, 0)).rate,
adapter.getItem(settings.getInt(FragmentCurrency.POSITION, 0)).code));
}
@Override
public void onPause() {
super.onPause();
}
public void tryAndSetAdapter() {
if (adapter.getCount() > 0) {
currencyList.setAdapter(adapter);
@ -94,44 +139,4 @@ public class FragmentCurrency extends Fragment {
}
}
private class ListInitiatorTask extends AsyncTask {
@Override
protected Object doInBackground(Object[] params) {
try {
Thread.sleep(400);
} catch (InterruptedException e) {
e.printStackTrace();
}
adapter = CurrencyManager.getCurrencyAddapterIfReady();
return null;
}
@Override
protected void onPostExecute(Object o) {
super.onPostExecute(o);
tryAndSetAdapter();
currencyRefresh.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
adapter = CurrencyManager.getCurrencyAddapterIfReady();
tryAndSetAdapter();
}
});
currencyList.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view,
int position, long id) {
adapter.notifyDataSetChanged();
currencyItemText = (TextView) view.findViewById(R.id.currency_item_text);
final String selectedCurrency = currencyItemText.getText().toString();
SharedPreferences.Editor editor = settings.edit();
editor.putString(CURRENT_CURRENCY, selectedCurrency.substring(0, 3));
editor.putInt(POSITION, position);
editor.commit();
}
});
}
}
}

4
app/src/main/java/com/breadwallet/presenter/fragments/FragmentScanResult.java

@ -47,6 +47,8 @@ public class FragmentScanResult extends Fragment implements View.OnClickListener
private RelativeLayout customKeyboardLayout;
private TextView amountToPay;
public static String address;
static final String DOUBLE_ARROW = "\u21CB";
static final String BITCOIN_LOWERCASE = "\u2422";
@Override
public View onCreateView(LayoutInflater inflater,
@ -67,6 +69,8 @@ public class FragmentScanResult extends Fragment implements View.OnClickListener
amountToPay = (TextView) getActivity().findViewById(R.id.amount_to_pay);
createCustomKeyboardButtons();
Log.e(TAG, "createCustomKeyboardButtons called!!!!!!");
// TextView doubleArrow = (TextView) getActivity().findViewById(R.id.test_text_charset);
// doubleArrow.setText(DOUBLE_ARROW);
}
@Override

89
app/src/main/java/com/breadwallet/presenter/fragments/FragmentSettings.java

@ -3,6 +3,7 @@ package com.breadwallet.presenter.fragments;
import android.content.DialogInterface;
import android.content.SharedPreferences;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v7.app.AlertDialog;
@ -14,25 +15,27 @@ import android.widget.RelativeLayout;
import android.widget.TextView;
import com.breadwallet.R;
import com.breadwallet.presenter.BreadWalletApp;
import com.breadwallet.presenter.activities.MainActivity;
import com.breadwallet.tools.animation.FragmentAnimator;
import com.breadwallet.tools.others.CurrencyManager;
/**
* BreadWallet
*
* <p/>
* Created by Mihail on 6/29/15.
* Copyright (c) 2015 Mihail Gutan <mihail@breadwallet.com>
*
* <p/>
* 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:
*
* <p/>
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* <p/>
* 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
@ -51,6 +54,7 @@ public class FragmentSettings extends Fragment {
private MainActivity app;
private FragmentSettings fragmentSettings;
private TextView currencyName;
private FragmentCurrency fragmentCurrency;
@Override
public View onCreateView(LayoutInflater inflater,
@ -63,15 +67,32 @@ public class FragmentSettings extends Fragment {
return rootView;
}
@Override
public void onResume() {
super.onResume();
Log.e(TAG, "In onResume");
((BreadWalletApp) getActivity().getApplication()).setTopMidleView(BreadWalletApp.SETTINGS_TEXT, "settings");
}
@Override
public void onPause() {
super.onPause();
Log.e(TAG, "In onPause");
((BreadWalletApp) getActivity().getApplication()).setTopMidleView(BreadWalletApp.BREAD_WALLET_IMAGE, "");
}
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
app = MainActivity.app;
fragmentSettings = this;
fragmentCurrency = app.fragmentCurrency;
new ListInitiatorTask().execute();
about = (RelativeLayout) getView().findViewById(R.id.about);
currencyName = (TextView) getView().findViewById(R.id.three_letters_currency);
SharedPreferences settings = getActivity().getSharedPreferences(MainActivity.PREFS_NAME, 0);
final String tmp = settings.getString(FragmentCurrency.CURRENT_CURRENCY, "USD");
Log.e(TAG, "Tmp 3 letters: " + tmp);
currencyName.setText(tmp);
localCurrency = (RelativeLayout) getView().findViewById(R.id.local_currency);
recoveryPhrase = (RelativeLayout) getView().findViewById(R.id.recovery_phrase);
@ -79,42 +100,64 @@ public class FragmentSettings extends Fragment {
startRecoveryWallet.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
FragmentAnimator.pressWipeWallet(app, app.fragmentWipeWallet);
app.activityButtonsEnable(false);
if (FragmentAnimator.checkTheMultipressingAvailability(300)) {
FragmentAnimator.pressWipeWallet(app, app.fragmentWipeWallet);
app.activityButtonsEnable(false);
}
}
});
recoveryPhrase.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
new AlertDialog.Builder(getActivity())
.setTitle(getResources().getString(R.string.warning))
.setMessage(getResources().getString(R.string.dialog_do_not_let_anyone))
.setPositiveButton(getResources().getString(R.string.show), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
FragmentAnimator.animateSlideToLeft(app, app.fragmentRecoveryPhrase, fragmentSettings);
}
})
.setNegativeButton(getResources().getString(R.string.cancel), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
Log.d(TAG, "Canceled the view of the phrase!");
}
})
.show();
if (FragmentAnimator.checkTheMultipressingAvailability(300)) {
new AlertDialog.Builder(getActivity())
.setTitle(getResources().getString(R.string.warning))
.setMessage(getResources().getString(R.string.dialog_do_not_let_anyone))
.setPositiveButton(getResources().getString(R.string.show), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
FragmentAnimator.animateSlideToLeft(app, app.fragmentRecoveryPhrase, fragmentSettings);
}
})
.setNegativeButton(getResources().getString(R.string.cancel), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
Log.d(TAG, "Canceled the view of the phrase!");
}
})
.show();
}
}
});
about.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
FragmentAnimator.animateSlideToLeft(app, app.fragmentAbout, fragmentSettings);
if (FragmentAnimator.checkTheMultipressingAvailability(300)) {
FragmentAnimator.animateSlideToLeft(app, app.fragmentAbout, fragmentSettings);
}
}
});
localCurrency.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
FragmentAnimator.animateSlideToLeft(app, app.fragmentCurrency, fragmentSettings);
if (FragmentAnimator.checkTheMultipressingAvailability(300)) {
FragmentAnimator.animateSlideToLeft(app, app.fragmentCurrency, fragmentSettings);
}
}
});
}
private class ListInitiatorTask extends AsyncTask {
@Override
protected void onPreExecute() {
super.onPreExecute();
}
@Override
protected Object doInBackground(Object[] params) {
fragmentCurrency.adapter = CurrencyManager.getCurrencyAddapterIfReady();
return null;
}
}
}

6
app/src/main/java/com/breadwallet/presenter/fragments/MainFragment.java

@ -69,8 +69,7 @@ public class MainFragment extends Fragment {
scanQRButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (FragmentAnimator.multiplePressingAvailable) {
FragmentAnimator.pauseTheAnimationAvailabilityFor(300);
if (FragmentAnimator.checkTheMultipressingAvailability(300)) {
FragmentAnimator.animateDecoderFragment();
}
}
@ -80,8 +79,7 @@ public class MainFragment extends Fragment {
payAddressFromClipboardButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (FragmentAnimator.multiplePressingAvailable) {
FragmentAnimator.pauseTheAnimationAvailabilityFor(300);
if (FragmentAnimator.checkTheMultipressingAvailability(300)) {
if (alertDialog.isShowing()) {
alertDialog.dismiss();
}

18
app/src/main/java/com/breadwallet/presenter/fragments/MainFragmentDecoder.java

@ -138,7 +138,13 @@ public class MainFragmentDecoder extends Fragment implements QRCodeReaderView.On
}
private void startQRScanner() {
MainActivity.app.activityButtonsEnable(false);
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
MainActivity.app.activityButtonsEnable(false);
}
}, 300);
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
@ -150,7 +156,8 @@ public class MainFragmentDecoder extends Fragment implements QRCodeReaderView.On
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
layout.addView(mydecoderview, 0);
if (mydecoderview != null)
layout.addView(mydecoderview, 0);
}
}, 800);
@ -170,12 +177,7 @@ public class MainFragmentDecoder extends Fragment implements QRCodeReaderView.On
}
});
mydecoderview = null;
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
MainActivity.app.activityButtonsEnable(true);
}
}, 300);
MainActivity.app.activityButtonsEnable(true);
}

37
app/src/main/java/com/breadwallet/presenter/fragments/MainFragmentQR.java

@ -87,8 +87,8 @@ public class MainFragmentQR extends Fragment {
addressLayout.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (FragmentAnimator.multiplePressingAvailable) {
FragmentAnimator.pauseTheAnimationAvailabilityFor(300);
breadWalletApp.cancelToast();
if (FragmentAnimator.checkTheMultipressingAvailability(300)) {
sharingFragment.setTheAddress(mainAddressText.getText().toString());
saveBitmapToFile();
sharingFragment.show(fm, "sharingFragment");
@ -98,21 +98,23 @@ public class MainFragmentQR extends Fragment {
qrcode.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (count == 0) {
if (firstToastY == -1)
firstToastY = BreadWalletApp.DISPLAY_HEIGHT_PX - breadWalletApp.getRelativeTop(mainAddressText) + 400;
breadWalletApp.showCustomToast(MainActivity.app,
getResources().getString(R.string.toast_qr_tip), firstToastY, Toast.LENGTH_LONG);
Log.e(TAG, "Toast show nr: " + count);
count++;
} else if (count == 1) {
if (secondToastY == -1)
secondToastY = BreadWalletApp.DISPLAY_HEIGHT_PX - breadWalletApp.getRelativeTop(mainAddressText);
breadWalletApp.showCustomToast(MainActivity.app,
getResources().getString(R.string.toast_address_tip),
secondToastY, Toast.LENGTH_LONG);
Log.e(TAG, "Toast show nr: " + count);
count--;
if (FragmentAnimator.checkTheMultipressingAvailability(300)) {
if (count == 0) {
if (firstToastY == -1)
firstToastY = BreadWalletApp.DISPLAY_HEIGHT_PX - breadWalletApp.getRelativeTop(mainAddressText) + 400;
breadWalletApp.showCustomToast(MainActivity.app,
getResources().getString(R.string.toast_qr_tip), firstToastY, Toast.LENGTH_LONG);
Log.e(TAG, "Toast show nr: " + count);
count++;
} else if (count == 1) {
if (secondToastY == -1)
secondToastY = BreadWalletApp.DISPLAY_HEIGHT_PX - breadWalletApp.getRelativeTop(mainAddressText);
breadWalletApp.showCustomToast(MainActivity.app,
getResources().getString(R.string.toast_address_tip),
secondToastY, Toast.LENGTH_LONG);
Log.e(TAG, "Toast show nr: " + count);
count--;
}
}
}
@ -170,4 +172,5 @@ public class MainFragmentQR extends Fragment {
}
}
}
}

9
app/src/main/java/com/breadwallet/presenter/fragments/MainFragmentSettingsAll.java

@ -56,8 +56,7 @@ public class MainFragmentSettingsAll extends Fragment {
importPrivateKeys.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (FragmentAnimator.multiplePressingAvailable) {
FragmentAnimator.pauseTheAnimationAvailabilityFor(300);
if (FragmentAnimator.checkTheMultipressingAvailability(300)) {
FragmentAnimator.animateDecoderFragment();
}
}
@ -75,8 +74,10 @@ public class MainFragmentSettingsAll extends Fragment {
settings.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
FragmentAnimator.animateSlideToLeft(app, app.fragmentSettings, mainMainFragmentSettingsAll);
Log.d(TAG, "Starting: showBouncySlide()");
if (FragmentAnimator.checkTheMultipressingAvailability(300)) {
FragmentAnimator.animateSlideToLeft(app, app.fragmentSettings, mainMainFragmentSettingsAll);
Log.d(TAG, "Starting: showBouncySlide()");
}
}
});
}

63
app/src/main/java/com/breadwallet/presenter/fragments/SharingFragment.java

@ -39,6 +39,7 @@ import android.widget.Toast;
import com.breadwallet.R;
import com.breadwallet.presenter.BreadWalletApp;
import com.breadwallet.tools.animation.FragmentAnimator;
import com.breadwallet.tools.others.MyClipboardManager;
public class SharingFragment extends DialogFragment {
@ -68,18 +69,20 @@ public class SharingFragment extends DialogFragment {
copyAddress.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
MyClipboardManager.copyToClipboard(getActivity(), theAddress);
if (customToastAvailable) {
customToastAvailable = false;
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
customToastAvailable = true;
}
}, 2000);
((BreadWalletApp) getActivity().getApplicationContext()).
showCustomToast(getActivity(), getResources().getString(R.string.toast_address_copied), 360, Toast.LENGTH_SHORT);
getDialog().cancel();
if (FragmentAnimator.checkTheMultipressingAvailability(300)) {
MyClipboardManager.copyToClipboard(getActivity(), theAddress);
if (customToastAvailable) {
customToastAvailable = false;
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
customToastAvailable = true;
}
}, 2000);
((BreadWalletApp) getActivity().getApplicationContext()).
showCustomToast(getActivity(), getResources().getString(R.string.toast_address_copied), 360, Toast.LENGTH_SHORT);
getDialog().cancel();
}
}
}
@ -88,33 +91,39 @@ public class SharingFragment extends DialogFragment {
sendEmail.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent emailIntent = new Intent(Intent.ACTION_SENDTO, Uri.fromParts(
"mailto", "", null));
emailIntent.putExtra(Intent.EXTRA_SUBJECT, getResources().getString(R.string.bitcoin_address));
emailIntent.putExtra(Intent.EXTRA_TEXT, getResources().getString(R.string.sharing_message) + " " + theAddress);
Uri uri = Uri.parse("file://" + MainFragmentQR.qrCodeImageFile.getAbsolutePath());
Log.e(TAG, "The qrCodeImageFile.getAbsolutePath(): " + MainFragmentQR.qrCodeImageFile.getAbsolutePath());
emailIntent.putExtra(Intent.EXTRA_STREAM, uri);
startActivity(Intent.createChooser(emailIntent, getResources().getString(R.string.dialog_email_title)));
getDialog().cancel();
if (FragmentAnimator.checkTheMultipressingAvailability(300)) {
Intent emailIntent = new Intent(Intent.ACTION_SENDTO, Uri.fromParts(
"mailto", "", null));
emailIntent.putExtra(Intent.EXTRA_SUBJECT, getResources().getString(R.string.bitcoin_address));
emailIntent.putExtra(Intent.EXTRA_TEXT, getResources().getString(R.string.sharing_message) + " " + theAddress);
Uri uri = Uri.parse("file://" + MainFragmentQR.qrCodeImageFile.getAbsolutePath());
Log.e(TAG, "The qrCodeImageFile.getAbsolutePath(): " + MainFragmentQR.qrCodeImageFile.getAbsolutePath());
emailIntent.putExtra(Intent.EXTRA_STREAM, uri);
startActivity(Intent.createChooser(emailIntent, getResources().getString(R.string.dialog_email_title)));
getDialog().cancel();
}
}
});
sendMessage.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent sendIntent = new Intent(Intent.ACTION_VIEW);
sendIntent.setData(Uri.parse("sms:"));
sendIntent.putExtra("sms_body", getResources().getString(R.string.sharing_message) + " " + theAddress);
startActivity(sendIntent);
getDialog().cancel();
if (FragmentAnimator.checkTheMultipressingAvailability(300)) {
Intent sendIntent = new Intent(Intent.ACTION_VIEW);
sendIntent.setData(Uri.parse("sms:"));
sendIntent.putExtra("sms_body", getResources().getString(R.string.sharing_message) + " " + theAddress);
startActivity(sendIntent);
getDialog().cancel();
}
}
});
requestAmount.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//TODO: actions on requesting amount
if(FragmentAnimator.checkTheMultipressingAvailability(300)){
//TODO: actions on requesting amount
}
}
});

11
app/src/main/java/com/breadwallet/tools/adapter/CurrencyListAdapter.java

@ -11,14 +11,11 @@ import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import com.breadwallet.R;
import com.breadwallet.presenter.activities.MainActivity;
import com.breadwallet.presenter.entities.CurrencyEntity;
import com.breadwallet.presenter.fragments.FragmentCurrency;
import java.util.ArrayList;
import java.util.List;
/**
* BreadWallet
* <p/>
@ -44,14 +41,13 @@ import java.util.List;
* THE SOFTWARE.
*/
public class CurrencyListAdapter extends ArrayAdapter<String> {
public class CurrencyListAdapter extends ArrayAdapter<CurrencyEntity> {
public static final String TAG = "CurrencyListAdapter";
Context mContext;
int layoutResourceId;
public TextView textViewItem;
public Point displayParameters = new Point();
public List<Integer> scaledItemsIDs = new ArrayList<>();
public CurrencyListAdapter(Context mContext, int layoutResourceId) {
@ -75,7 +71,7 @@ public class CurrencyListAdapter extends ArrayAdapter<String> {
// get the TextView and then set the text (item name) and tag (item ID) values
textViewItem = null;
textViewItem = (TextView) convertView.findViewById(R.id.currency_item_text);
textViewItem.setText(this.getItem(position));
textViewItem.setText(this.getItem(position).codeAndName);
ImageView checkMark = (ImageView) convertView.findViewById(R.id.currency_checkmark);
if (position == tmp) {
@ -84,7 +80,6 @@ public class CurrencyListAdapter extends ArrayAdapter<String> {
checkMark.setVisibility(View.GONE);
}
normalizeTextView();
return convertView;
}

1
app/src/main/java/com/breadwallet/tools/adapter/CustomPagerAdapter.java

@ -44,7 +44,6 @@ public class CustomPagerAdapter extends FragmentPagerAdapter {
public MainFragment mainFragment;
public MainFragmentQR mainFragmentQR;
private List<Fragment> fragments;
private boolean available = true;
private View main;
private View mainQR;
public static CustomPagerAdapter adapter;

2
app/src/main/java/com/breadwallet/tools/adapter/ParallaxViewPager.java

@ -13,6 +13,7 @@ import android.support.v4.view.ViewPager;
import android.util.AttributeSet;
import android.util.Log;
import com.breadwallet.presenter.BreadWalletApp;
import com.breadwallet.presenter.activities.MainActivity;
import com.breadwallet.tools.animation.FragmentAnimator;
import com.breadwallet.tools.animation.SpringAnimator;
@ -105,6 +106,7 @@ public class ParallaxViewPager extends ViewPager {
if (secondOnPageChangeListener != null) {
secondOnPageChangeListener.onPageSelected(position);
}
((BreadWalletApp) MainActivity.app.getApplication()).cancelToast();
app.setPagerIndicator(position);
if (FragmentAnimator.level == 0) {
if (position == 1) {

208
app/src/main/java/com/breadwallet/tools/animation/FragmentAnimator.java

@ -9,6 +9,7 @@ import android.view.View;
import android.view.inputmethod.InputMethodManager;
import com.breadwallet.R;
import com.breadwallet.presenter.BreadWalletApp;
import com.breadwallet.presenter.activities.MainActivity;
import com.breadwallet.tools.adapter.CustomPagerAdapter;
@ -41,12 +42,10 @@ import java.util.Stack;
public class FragmentAnimator {
public static final String TAG = "FragmentAnimator";
public static boolean settingsAllON;
public static boolean settingsAvailable = true;
public static int level = 0;
public static boolean wipeWalletOpen = false;
public static Stack<Fragment> previous = new Stack<>();
public static boolean multiplePressingAvailable = true;
private static boolean multiplePressingAvailable = true;
public static Object lockObject = new Object();
public static void animateDecoderFragment() {
@ -89,39 +88,37 @@ public class FragmentAnimator {
* Animate the transition on burgerButton/MenuButton pressed
*/
public static void pressMenuButton(final MainActivity context, final Fragment to) {
if (multiplePressingAvailable) {
pauseTheAnimationAvailabilityFor(300);
if (level == 0) {
level++;
MainActivity.app.setBurgerButtonImage(context.CLOSE);
FragmentTransaction fragmentTransaction = context.getSupportFragmentManager().beginTransaction();
fragmentTransaction.setCustomAnimations(R.animator.from_top, R.animator.from_top);
fragmentTransaction.replace(R.id.mainlayout, context.mainFragmentSettingsAll);
fragmentTransaction.commit();
CustomPagerAdapter.adapter.showFragments(false);
context.pageIndicator.setVisibility(View.GONE);
InputMethodManager keyboard = (InputMethodManager) MainActivity.app.
getSystemService(Context.INPUT_METHOD_SERVICE);
keyboard.hideSoftInputFromWindow(CustomPagerAdapter.adapter.
mainFragment.addressEditText.getWindowToken(), 0);
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
SpringAnimator.showBouncySlideVertical(to.getView(), SpringAnimator.TO_LEFT);
}
}, 200);
} else if (level == 1) {
level--;
settingsAllON = false;
MainActivity.app.setBurgerButtonImage(context.BURGER);
FragmentTransaction fragmentTransaction = context.getSupportFragmentManager().beginTransaction();
fragmentTransaction.setCustomAnimations(R.animator.to_top, R.animator.to_top);
fragmentTransaction.remove(context.mainFragmentSettingsAll);
fragmentTransaction.commit();
CustomPagerAdapter.adapter.showFragments(true);
context.pageIndicator.setVisibility(View.VISIBLE);
}
((BreadWalletApp) MainActivity.app.getApplication()).cancelToast();
Log.e(TAG, "The level is: " + level);
if (level == 0) {
level++;
MainActivity.app.setBurgerButtonImage(context.CLOSE);
FragmentTransaction fragmentTransaction = context.getSupportFragmentManager().beginTransaction();
fragmentTransaction.setCustomAnimations(R.animator.from_top, R.animator.from_top);
fragmentTransaction.replace(R.id.mainlayout, context.mainFragmentSettingsAll);
fragmentTransaction.commit();
CustomPagerAdapter.adapter.showFragments(false);
context.pageIndicator.setVisibility(View.GONE);
InputMethodManager keyboard = (InputMethodManager) MainActivity.app.
getSystemService(Context.INPUT_METHOD_SERVICE);
keyboard.hideSoftInputFromWindow(CustomPagerAdapter.adapter.
mainFragment.addressEditText.getWindowToken(), 0);
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
SpringAnimator.showBouncySlideVertical(to.getView(), SpringAnimator.TO_LEFT);
}
}, 200);
} else if (level == 1) {
level--;
MainActivity.app.setBurgerButtonImage(context.BURGER);
FragmentTransaction fragmentTransaction = context.getSupportFragmentManager().beginTransaction();
fragmentTransaction.setCustomAnimations(R.animator.to_top, R.animator.to_top);
fragmentTransaction.remove(context.mainFragmentSettingsAll);
fragmentTransaction.commit();
CustomPagerAdapter.adapter.showFragments(true);
context.pageIndicator.setVisibility(View.VISIBLE);
}
}
@ -129,92 +126,95 @@ public class FragmentAnimator {
* Animate the transition on wipe wallet fragment
*/
public static void pressWipeWallet(final MainActivity context, final Fragment to) {
if (multiplePressingAvailable) {
pauseTheAnimationAvailabilityFor(300);
if (!wipeWalletOpen) {
wipeWalletOpen = true;
FragmentTransaction fragmentTransaction = context.getSupportFragmentManager().beginTransaction();
fragmentTransaction.setCustomAnimations(R.animator.from_bottom, R.animator.to_top);
fragmentTransaction.replace(R.id.mainlayout, to);
fragmentTransaction.commit();
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
SpringAnimator.showBouncySlideVertical(MainActivity.app.fragmentWipeWallet.getView(), SpringAnimator.TO_RIGHT);
}
}, 200);
} else {
wipeWalletOpen = false;
FragmentTransaction fragmentTransaction = context.getSupportFragmentManager().beginTransaction();
fragmentTransaction.setCustomAnimations(R.animator.from_top, R.animator.to_bottom);
fragmentTransaction.replace(R.id.mainlayout, context.fragmentSettings);
fragmentTransaction.commit();
}
}
}
/**
* Animates the fragment transition on button "Settings" pressed
*/
public static void animateSlideToLeft(MainActivity context, final Fragment to, Fragment previousFragment) {
if (multiplePressingAvailable) {
pauseTheAnimationAvailabilityFor(300);
level++;
if (level > 1)
context.setBurgerButtonImage(context.BACK);
if (!wipeWalletOpen) {
wipeWalletOpen = true;
FragmentTransaction fragmentTransaction = context.getSupportFragmentManager().beginTransaction();
fragmentTransaction.setCustomAnimations(R.animator.from_right, R.animator.to_left);
fragmentTransaction.setCustomAnimations(R.animator.from_bottom, R.animator.to_top);
fragmentTransaction.replace(R.id.mainlayout, to);
fragmentTransaction.commit();
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
SpringAnimator.showBouncySlide(to.getView(), SpringAnimator.TO_RIGHT, 20);
SpringAnimator.showBouncySlideVertical(MainActivity.app.fragmentWipeWallet.getView(), SpringAnimator.TO_RIGHT);
}
}, 200);
previous.add(previousFragment);
} else {
wipeWalletOpen = false;
FragmentTransaction fragmentTransaction = context.getSupportFragmentManager().beginTransaction();
fragmentTransaction.setCustomAnimations(R.animator.from_top, R.animator.to_bottom);
fragmentTransaction.replace(R.id.mainlayout, context.fragmentSettings);
fragmentTransaction.commit();
Log.e(TAG, "The level is: " + level);
}
}
/**
* Animates the fragment transition on button "Settings" pressed
*/
public static void animateSlideToLeft(MainActivity context, final Fragment to, Fragment previousFragment) {
level++;
if (level > 1)
context.setBurgerButtonImage(context.BACK);
FragmentTransaction fragmentTransaction = context.getSupportFragmentManager().beginTransaction();
fragmentTransaction.setCustomAnimations(R.animator.from_right, R.animator.to_left);
fragmentTransaction.replace(R.id.mainlayout, to);
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
SpringAnimator.showBouncySlide(to.getView(), SpringAnimator.TO_RIGHT, 20);
}
}, 200);
previous.add(previousFragment);
fragmentTransaction.commit();
Log.e(TAG, "The level is: " + level);
}
public static void animateSlideToRight(MainActivity context) {
if (multiplePressingAvailable) {
pauseTheAnimationAvailabilityFor(300);
final Fragment tmp = previous.pop();
level--;
if (level < 1)
context.setBurgerButtonImage(context.BURGER);
if (level == 1)
context.setBurgerButtonImage(context.CLOSE);
final Fragment tmp = previous.pop();
level--;
if (level < 1)
context.setBurgerButtonImage(context.BURGER);
if (level == 1)
context.setBurgerButtonImage(context.CLOSE);
// Log.e(TAG, "The actual SettingsFragment: " + tmp);
FragmentTransaction fragmentTransaction = context.getSupportFragmentManager().beginTransaction();
fragmentTransaction.setCustomAnimations(R.animator.from_left, R.animator.to_right);
fragmentTransaction.replace(R.id.mainlayout, tmp);
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
SpringAnimator.showBouncySlide(tmp.getView(), SpringAnimator.TO_LEFT, 20);
}
}, 200);
fragmentTransaction.commit();
Log.e(TAG, "The level is: " + level);
}
FragmentTransaction fragmentTransaction = context.getSupportFragmentManager().beginTransaction();
fragmentTransaction.setCustomAnimations(R.animator.from_left, R.animator.to_right);
fragmentTransaction.replace(R.id.mainlayout, tmp);
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
SpringAnimator.showBouncySlide(tmp.getView(), SpringAnimator.TO_LEFT, 20);
}
}, 200);
fragmentTransaction.commit();
Log.e(TAG, "The level is: " + level);
}
public static void pauseTheAnimationAvailabilityFor(int delay) {
/**
* Checks if the multipressing is available and if available:
* - make it unavailable for delay milliseconds and return true,
* else :
* - return false.
*
* @param delay in milliseconds
*/
public static boolean checkTheMultipressingAvailability(int delay) {
synchronized (lockObject) {
multiplePressingAvailable = false;
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
multiplePressingAvailable = true;
// Log.w(TAG, "multiplePressingAvailable is back to - true");
}
}, delay);
if (multiplePressingAvailable) {
multiplePressingAvailable = false;
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
multiplePressingAvailable = true;
Log.w(TAG, "multiplePressingAvailable is back to - true");
}
}, delay);
return true;
} else {
return false;
}
}
}
public static void hideDecoderFragment() {

108
app/src/main/java/com/breadwallet/tools/others/CurrencyManager.java

@ -9,14 +9,20 @@ import android.util.Log;
import com.breadwallet.R;
import com.breadwallet.presenter.activities.MainActivity;
import com.breadwallet.presenter.entities.CurrencyEntity;
import com.breadwallet.tools.adapter.CurrencyListAdapter;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.text.NumberFormat;
import java.util.ArrayList;
import java.util.Currency;
import java.util.List;
import java.util.Locale;
import java.util.Timer;
import java.util.TimerTask;
@ -60,33 +66,39 @@ public class CurrencyManager {
return activeNetworkInfo != null && activeNetworkInfo.isConnected();
}
public static List<String> getCurrencies() {
List<String> list = null;
public static List<CurrencyEntity> getCurrencies() {
List<CurrencyEntity> list = new ArrayList<>();
if (isNetworkAvailable()) {
list = new ArrayList<>();
JSONArray arr;
arr = JsonParser.getJSonArray("https://bitpay.com/rates");
int length = arr.length();
for (int i = 1; i < length; i++) {
String tmp = null;
CurrencyEntity tmp = new CurrencyEntity();
try {
JSONObject tmpObj = (JSONObject) arr.get(i);
tmp = tmpObj.getString("code") + " - " + tmpObj.getString("name");
tmp.name = tmpObj.getString("name");
tmp.code = tmpObj.getString("code");
tmp.codeAndName = tmp.code + " - " + tmp.name;
tmp.rate = tmpObj.getDouble("rate");
} catch (JSONException e) {
e.printStackTrace();
}
list.add(tmp);
}
} else {
if (list == null) list = new ArrayList<>();
}
if (list.size() > 0)
list.add("TES - testing text extra long text mega long text oh my god that's a long text");
if (list.size() > 0) {
CurrencyEntity test = new CurrencyEntity();
test.name = "testing text extra long text mega long text oh my god that's a long text";
test.code = "TES";
test.codeAndName = test.code + " - " + test.name;
test.rate = 0.999;
list.add(test);
}
return list;
}
public static class GetCurrenciesTask extends AsyncTask {
List<String> tmp;
List<CurrencyEntity> tmp;
@Override
protected Object doInBackground(Object[] params) {
@ -147,4 +159,80 @@ public class CurrencyManager {
timer = null;
}
}
public static String getTheFinalExchangeString(double target, double current, String iso) {
double result = target * 1000000 / current;
Log.e(TAG, "result of the exchange rate calculation: " + result);
DecimalFormat decimalFormat = new DecimalFormat("0.00");
return getFormattedCurrencyString(iso, 1) + " = b" + decimalFormat.format(result);
}
public static String getFormattedCurrencyString(String isoCurrencyCode, double amount) {
// This formats currency values as the user expects to read them (default locale).
NumberFormat currencyFormat = NumberFormat.getCurrencyInstance();
// This specifies the actual currency that the value is in, and provides the currency symbol.
Currency currency;
try {
currency = Currency.getInstance(isoCurrencyCode);
Log.e(TAG, "Currency.getInstance succeeded: " + currency.getSymbol());
} catch (IllegalArgumentException e) {
Log.e(TAG, "Currency.getInstance did not succeed, going with the default", e);
currency = Currency.getInstance(Locale.getDefault());
}
// Note we don't supply a locale to this method - uses default locale to format the currency symbol.
String symbol = currency.getSymbol();
// We then tell our formatter to use this symbol.
DecimalFormatSymbols decimalFormatSymbols = ((java.text.DecimalFormat) currencyFormat).getDecimalFormatSymbols();
decimalFormatSymbols.setCurrencySymbol(symbol);
((java.text.DecimalFormat) currencyFormat).setDecimalFormatSymbols(decimalFormatSymbols);
return currencyFormat.format(amount);
}
public static String getFormattedCurrencyStringForLocale(Locale locale, String isoCurrencyCode, double amount) {
// This formats currency values as the user expects to read them (default locale).
NumberFormat currencyFormat = NumberFormat.getCurrencyInstance(locale);
// This specifies the actual currency that the value is in, and provides the currency symbol.
Currency currency = Currency.getInstance(isoCurrencyCode);
// Note we don't supply a locale to this method - uses default locale to format the currency symbol.
String symbol = currency.getSymbol(locale);
// We then tell our formatter to use this symbol.
DecimalFormatSymbols decimalFormatSymbols = ((java.text.DecimalFormat) currencyFormat).getDecimalFormatSymbols();
decimalFormatSymbols.setCurrencySymbol(symbol);
((java.text.DecimalFormat) currencyFormat).setDecimalFormatSymbols(decimalFormatSymbols);
return currencyFormat.format(amount);
}
public static String getFormattedCurrencyStringFixed(Locale locale, String isoCurrencyCode, double amount) {
// This formats currency values as the user expects to read them in the supplied locale.
NumberFormat currencyFormat = NumberFormat.getCurrencyInstance(locale);
// This specifies the actual currency that the value is in, and provides
// the currency symbol that is used
Currency currency = Currency.getInstance(isoCurrencyCode);
// Our fix is to use the US locale as default for the symbol, unless the currency is USD
// and the locale is NOT the US, in which case we know it should be US$.
String symbol;
if (isoCurrencyCode.equalsIgnoreCase("usd") && !locale.equals(Locale.US)) {
symbol = "US$";// currency.getSymbol(Locale.UK);
} else {
symbol = currency.getSymbol(Locale.US); // US locale has the best symbol formatting table.
}
// We tell our formatter to use this symbol
DecimalFormatSymbols decimalFormatSymbols = ((java.text.DecimalFormat) currencyFormat).getDecimalFormatSymbols();
decimalFormatSymbols.setCurrencySymbol(symbol);
((java.text.DecimalFormat) currencyFormat).setDecimalFormatSymbols(decimalFormatSymbols);
return currencyFormat.format(amount);
}
}

35
app/src/main/res/layouts/activities/layout/activity_main.xml

@ -6,23 +6,38 @@
android:layout_height="match_parent"
tools:context="com.breadwallet.presenter.activities.MainActivity">
<ImageView
android:id="@+id/maintextbreadwallet"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
<ViewFlipper
android:id="@+id/middle_view_flipper"
android:layout_width="300dp"
android:layout_height="28dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="20dp"
android:background="@drawable/breadwalletupcentered" />
android:layout_marginTop="20dp">
<ImageView
android:id="@+id/maintextbreadwallet"
android:layout_width="120dp"
android:layout_height="20dp"
android:layout_gravity="center"
android:layout_centerHorizontal="true"
android:background="@drawable/breadwalletupcentered" />
<TextView
android:layout_width="wrap_content"
android:layout_height="28dp"
android:layout_centerHorizontal="true"
android:layout_gravity="center"
android:text="settings"
android:textColor="@color/grey"
android:textSize="22sp"></TextView>
</ViewFlipper>
<Button
android:id="@+id/mainbuttonburger"
android:layout_width="25dp"
android:layout_height="22dp"
android:layout_alignBottom="@+id/maintextbreadwallet"
android:layout_alignParentStart="true"
android:layout_marginLeft="16dp"
android:layout_marginTop="20dp"
android:background="@drawable/burger" />
@ -30,7 +45,7 @@
android:id="@+id/mainbuttonlocker"
android:layout_width="20dp"
android:layout_height="27dp"
android:layout_alignBottom="@+id/maintextbreadwallet"
android:layout_alignBottom="@+id/mainbuttonburger"
android:layout_alignParentEnd="true"
android:layout_marginRight="16dp"
android:background="@drawable/locker" />
@ -40,7 +55,7 @@
android:id="@+id/pager"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/maintextbreadwallet"
android:layout_below="@+id/mainbuttonburger"
android:layout_marginTop="10dp" />
<RelativeLayout

4
app/src/main/res/layouts/fragments/layout/fragment_local_currency.xml

@ -12,7 +12,9 @@
<ListView
android:id="@+id/currency_list_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"></ListView>
android:layout_height="wrap_content"
android:listSelector="@color/white"
android:cacheColorHint="@android:color/transparent"></ListView>
<TextView
android:id="@+id/noInternetConnectionText"

1
app/src/main/res/layouts/fragments/layout/fragment_main.xml

@ -26,6 +26,7 @@
android:layout_gravity="center"
android:layout_marginTop="32dp"
android:background="@drawable/button"
android:src="@drawable/cameraguide_blue_small"
android:text="scan QR code"
android:textColor="@color/darkblue"
android:textSize="20sp" />

3
app/src/main/res/layouts/fragments/layout/fragment_scan_result.xml

@ -66,10 +66,11 @@
android:id="@+id/imageView" />
<TextView
android:layout_marginRight="5dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="26sp"
android:id="@+id/test_text_charset"
android:text="&#9250;"
android:layout_alignBottom="@+id/imageView"
android:layout_toStartOf="@+id/imageView" />

BIN
captures/Snapshot_2015.07.15_14.14.21.hprof

Binary file not shown.

BIN
captures/Snapshot_2015.07.15_14.14.39.hprof

Binary file not shown.

BIN
captures/Snapshot_2015.07.15_14.27.28.hprof

Binary file not shown.

BIN
captures/Snapshot_2015.07.15_14.27.43.hprof

Binary file not shown.

BIN
captures/Snapshot_2015.07.15_14.28.00.hprof

Binary file not shown.
Loading…
Cancel
Save