mirror of https://github.com/m2049r/xmrwallet.git
Merge pull request #29 from m2049r/bugfix_fragment_v4
use v4 fragment support library to cater for android 5.1
This commit is contained in:
commit
20dbaac4fa
|
@ -16,9 +16,9 @@
|
|||
|
||||
package com.m2049r.xmrwallet;
|
||||
|
||||
import android.app.Fragment;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.text.Editable;
|
||||
import android.text.InputType;
|
||||
import android.text.TextWatcher;
|
||||
|
|
|
@ -16,9 +16,9 @@
|
|||
|
||||
package com.m2049r.xmrwallet;
|
||||
|
||||
import android.app.Fragment;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
|
|
@ -17,9 +17,6 @@
|
|||
package com.m2049r.xmrwallet;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Fragment;
|
||||
import android.app.FragmentManager;
|
||||
import android.app.FragmentTransaction;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
|
@ -27,6 +24,10 @@ import android.content.SharedPreferences;
|
|||
import android.content.pm.PackageManager;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.v4.app.Fragment;
|
||||
|
||||
import android.support.v4.app.FragmentManager;
|
||||
import android.support.v4.app.FragmentTransaction;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.util.Log;
|
||||
|
@ -281,7 +282,7 @@ public class LoginActivity extends AppCompatActivity
|
|||
|
||||
void startLoginFragment() {
|
||||
Fragment fragment = new LoginFragment();
|
||||
getFragmentManager().beginTransaction()
|
||||
getSupportFragmentManager().beginTransaction()
|
||||
.add(R.id.fragment_container, fragment).commit();
|
||||
Log.d(TAG, "LoginFragment added");
|
||||
}
|
||||
|
@ -300,7 +301,7 @@ public class LoginActivity extends AppCompatActivity
|
|||
if (extras != null) {
|
||||
newFragment.setArguments(extras);
|
||||
}
|
||||
FragmentTransaction transaction = getFragmentManager().beginTransaction();
|
||||
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
|
||||
transaction.replace(R.id.fragment_container, newFragment);
|
||||
transaction.addToBackStack(stackName);
|
||||
transaction.commit();
|
||||
|
@ -317,7 +318,7 @@ public class LoginActivity extends AppCompatActivity
|
|||
|
||||
public void createWallet(final String name, final String password, final WalletCreator walletCreator) {
|
||||
final GenerateFragment genFragment = (GenerateFragment)
|
||||
getFragmentManager().findFragmentById(R.id.fragment_container);
|
||||
getSupportFragmentManager().findFragmentById(R.id.fragment_container);
|
||||
File newWalletFolder = new File(getStorageRoot(), ".new");
|
||||
if (!newWalletFolder.exists()) {
|
||||
if (!newWalletFolder.mkdir()) {
|
||||
|
|
|
@ -16,12 +16,12 @@
|
|||
|
||||
package com.m2049r.xmrwallet;
|
||||
|
||||
import android.app.Fragment;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
import android.os.StrictMode;
|
||||
import android.support.design.widget.FloatingActionButton;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.util.Log;
|
||||
import android.view.ContextMenu;
|
||||
import android.view.KeyEvent;
|
||||
|
|
|
@ -16,10 +16,10 @@
|
|||
|
||||
package com.m2049r.xmrwallet;
|
||||
|
||||
import android.app.Fragment;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
|
|
|
@ -16,11 +16,11 @@
|
|||
|
||||
package com.m2049r.xmrwallet;
|
||||
|
||||
import android.app.Fragment;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.support.v7.app.AlertDialog;
|
||||
import android.text.Editable;
|
||||
import android.text.InputType;
|
||||
|
|
|
@ -16,28 +16,23 @@
|
|||
|
||||
package com.m2049r.xmrwallet;
|
||||
|
||||
import android.app.Fragment;
|
||||
import android.content.ClipData;
|
||||
import android.content.ClipboardManager;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.text.InputType;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.m2049r.xmrwallet.model.TransactionInfo;
|
||||
import com.m2049r.xmrwallet.model.Transfer;
|
||||
import com.m2049r.xmrwallet.model.Wallet;
|
||||
import com.m2049r.xmrwallet.model.WalletManager;
|
||||
import com.m2049r.xmrwallet.service.MoneroHandlerThread;
|
||||
|
||||
import java.io.File;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
|
|
|
@ -16,9 +16,6 @@
|
|||
|
||||
package com.m2049r.xmrwallet;
|
||||
|
||||
import android.app.Fragment;
|
||||
import android.app.FragmentManager;
|
||||
import android.app.FragmentTransaction;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
|
@ -28,6 +25,9 @@ import android.os.Bundle;
|
|||
import android.os.IBinder;
|
||||
import android.os.PowerManager;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.support.v4.app.FragmentManager;
|
||||
import android.support.v4.app.FragmentTransaction;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.util.Log;
|
||||
|
@ -155,7 +155,7 @@ public class WalletActivity extends AppCompatActivity implements WalletFragment.
|
|||
}
|
||||
|
||||
Fragment walletFragment = new WalletFragment();
|
||||
getFragmentManager().beginTransaction()
|
||||
getSupportFragmentManager().beginTransaction()
|
||||
.add(R.id.fragment_container, walletFragment).commit();
|
||||
Log.d(TAG, "fragment added");
|
||||
|
||||
|
@ -336,7 +336,7 @@ public class WalletActivity extends AppCompatActivity implements WalletFragment.
|
|||
Log.d(TAG, "onRefreshed()");
|
||||
try {
|
||||
final WalletFragment walletFragment = (WalletFragment)
|
||||
getFragmentManager().findFragmentById(R.id.fragment_container);
|
||||
getSupportFragmentManager().findFragmentById(R.id.fragment_container);
|
||||
if (wallet.isSynchronized()) {
|
||||
Log.d(TAG, "onRefreshed() synced");
|
||||
releaseWakeLock(); // the idea is to stay awake until synced
|
||||
|
@ -401,7 +401,7 @@ public class WalletActivity extends AppCompatActivity implements WalletFragment.
|
|||
public void onCreatedTransaction(final PendingTransaction pendingTransaction) {
|
||||
try {
|
||||
final SendFragment sendFragment = (SendFragment)
|
||||
getFragmentManager().findFragmentById(R.id.fragment_container);
|
||||
getSupportFragmentManager().findFragmentById(R.id.fragment_container);
|
||||
runOnUiThread(new Runnable() {
|
||||
public void run() {
|
||||
PendingTransaction.Status status = pendingTransaction.getStatus();
|
||||
|
@ -440,7 +440,7 @@ public class WalletActivity extends AppCompatActivity implements WalletFragment.
|
|||
public void onSetNotes(final boolean success) {
|
||||
try {
|
||||
final TxFragment txFragment = (TxFragment)
|
||||
getFragmentManager().findFragmentById(R.id.fragment_container);
|
||||
getSupportFragmentManager().findFragmentById(R.id.fragment_container);
|
||||
runOnUiThread(new Runnable() {
|
||||
public void run() {
|
||||
if (!success) {
|
||||
|
@ -460,7 +460,7 @@ public class WalletActivity extends AppCompatActivity implements WalletFragment.
|
|||
public void onProgress(final String text) {
|
||||
try {
|
||||
final WalletFragment walletFragment = (WalletFragment)
|
||||
getFragmentManager().findFragmentById(R.id.fragment_container);
|
||||
getSupportFragmentManager().findFragmentById(R.id.fragment_container);
|
||||
runOnUiThread(new Runnable() {
|
||||
public void run() {
|
||||
walletFragment.onProgress(text);
|
||||
|
@ -477,7 +477,7 @@ public class WalletActivity extends AppCompatActivity implements WalletFragment.
|
|||
public void onProgress(final int n) {
|
||||
try {
|
||||
final WalletFragment walletFragment = (WalletFragment)
|
||||
getFragmentManager().findFragmentById(R.id.fragment_container);
|
||||
getSupportFragmentManager().findFragmentById(R.id.fragment_container);
|
||||
runOnUiThread(new Runnable() {
|
||||
public void run() {
|
||||
walletFragment.onProgress(n);
|
||||
|
@ -583,14 +583,14 @@ public class WalletActivity extends AppCompatActivity implements WalletFragment.
|
|||
if (extras != null) {
|
||||
newFragment.setArguments(extras);
|
||||
}
|
||||
FragmentTransaction transaction = getFragmentManager().beginTransaction();
|
||||
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
|
||||
transaction.replace(R.id.fragment_container, newFragment);
|
||||
transaction.addToBackStack(stackName);
|
||||
transaction.commit();
|
||||
}
|
||||
|
||||
private void onWalletDetails() {
|
||||
Fragment fragment = getFragmentManager().findFragmentById(R.id.fragment_container);
|
||||
Fragment fragment = getSupportFragmentManager().findFragmentById(R.id.fragment_container);
|
||||
if (!(fragment instanceof GenerateReviewFragment)) {
|
||||
Bundle extras = new Bundle();
|
||||
extras.putString("type", GenerateReviewFragment.VIEW_WALLET);
|
||||
|
@ -605,7 +605,7 @@ public class WalletActivity extends AppCompatActivity implements WalletFragment.
|
|||
|
||||
|
||||
private void startScanFragment() {
|
||||
Fragment fragment = getFragmentManager().findFragmentById(R.id.fragment_container);
|
||||
Fragment fragment = getSupportFragmentManager().findFragmentById(R.id.fragment_container);
|
||||
if (fragment instanceof SendFragment) {
|
||||
Bundle extras = new Bundle();
|
||||
replaceFragment(new ScannerFragment(), null, extras);
|
||||
|
|
|
@ -16,21 +16,16 @@
|
|||
|
||||
package com.m2049r.xmrwallet;
|
||||
|
||||
import android.app.Fragment;
|
||||
import android.content.ClipData;
|
||||
import android.content.ClipboardManager;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.os.Bundle;
|
||||
import android.support.constraint.ConstraintLayout;
|
||||
import android.support.v7.app.AlertDialog;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.support.v7.widget.DividerItemDecoration;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.animation.Interpolator;
|
||||
import android.widget.Button;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.ProgressBar;
|
||||
|
@ -38,9 +33,7 @@ import android.widget.TextView;
|
|||
|
||||
import com.m2049r.xmrwallet.layout.TransactionInfoAdapter;
|
||||
import com.m2049r.xmrwallet.model.TransactionInfo;
|
||||
import com.m2049r.xmrwallet.model.Transfer;
|
||||
import com.m2049r.xmrwallet.model.Wallet;
|
||||
import com.m2049r.xmrwallet.model.WalletManager;
|
||||
|
||||
import java.text.NumberFormat;
|
||||
import java.util.List;
|
||||
|
|
Loading…
Reference in New Issue