Java Code Examples for net.bither.bitherj.qrcode.QRCodeUtil#QRQuality

The following examples show how to use net.bither.bitherj.qrcode.QRCodeUtil#QRQuality . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: UserPreference.java    From bither-desktop-java with Apache License 2.0 5 votes vote down vote up
public QRCodeUtil.QRQuality getQRQuality() {
    int ordinal = getInt(QR_QUALITY, -1);
    if (ordinal < QRCodeUtil.QRQuality.values().length && ordinal >= 0) {
        return QRCodeUtil.QRQuality.values()[ordinal];
    }
    return QRCodeUtil.QRQuality.Normal;

}
 
Example 2
Source File: UserPreference.java    From bither-desktop-java with Apache License 2.0 5 votes vote down vote up
public void setQRQuality(QRCodeUtil.QRQuality qrQuality) {
    int index = -1;
    if (qrQuality != null) {
        index = qrQuality.ordinal();
    }
    setValue(QR_QUALITY, Integer.toString(index));

}
 
Example 3
Source File: AppSharedPreference.java    From bither-android with Apache License 2.0 5 votes vote down vote up
public QRCodeUtil.QRQuality getQRQuality() {
    int ordinal = this.mPreferences.getInt(QR_QUALITY, 0);
    if (ordinal < QRCodeUtil.QRQuality.values().length && ordinal >= 0) {
        return QRCodeUtil.QRQuality.values()[ordinal];
    }
    return QRCodeUtil.QRQuality.Normal;

}
 
Example 4
Source File: AppSharedPreference.java    From bither-android with Apache License 2.0 5 votes vote down vote up
public void setQRQuality(QRCodeUtil.QRQuality qrQuality) {
    int index = -1;
    if (qrQuality != null) {
        index = qrQuality.ordinal();
    }
    this.mPreferences.edit().putInt(QR_QUALITY, index).commit();
}
 
Example 5
Source File: UserPreference.java    From bither-desktop-java with Apache License 2.0 5 votes vote down vote up
public QRCodeUtil.QRQuality getQRQuality() {
    int ordinal = getInt(QR_QUALITY, -1);
    if (ordinal < QRCodeUtil.QRQuality.values().length && ordinal >= 0) {
        return QRCodeUtil.QRQuality.values()[ordinal];
    }
    return QRCodeUtil.QRQuality.Normal;

}
 
Example 6
Source File: UserPreference.java    From bither-desktop-java with Apache License 2.0 5 votes vote down vote up
public void setQRQuality(QRCodeUtil.QRQuality qrQuality) {
    int index = -1;
    if (qrQuality != null) {
        index = qrQuality.ordinal();
    }
    setValue(QR_QUALITY, Integer.toString(index));

}
 
Example 7
Source File: DesktopImplAbstractApp.java    From bither-desktop-java with Apache License 2.0 4 votes vote down vote up
@Override
public ISetting initSetting() {
    return new ISetting() {
        @Override
        public BitherjSettings.AppMode getAppMode() {
            return UserPreference.getInstance().getAppMode();
        }

        @Override
        public boolean getBitherjDoneSyncFromSpv() {
            return UserPreference.getInstance().getBitherjDoneSyncFromSpv();
        }

        @Override
        public void setBitherjDoneSyncFromSpv(boolean isDone) {
            UserPreference.getInstance().setBitherjDoneSyncFromSpv(isDone);
        }

        @Override
        public boolean getDownloadSpvFinish() {
            return UserPreference.getInstance().getDownloadSpvFinish();
        }

        @Override
        public void setDownloadSpvFinish(boolean finish) {
            UserPreference.getInstance().setDownloadSpvFinish(finish);

        }

        @Override
        public BitherjSettings.TransactionFeeMode getTransactionFeeMode() {
            return UserPreference.getInstance().getTransactionFeeMode();
        }

        @Override
        public File getPrivateDir(String dirName) {
            File file = new File(new ApplicationDataDirectoryLocator().getApplicationDataDirectory() + File.separator + dirName);
            if (!file.exists()) {
                file.mkdirs();
            }
            return file;
        }

        @Override
        public boolean isApplicationRunInForeground() {

            return true;
        }

        @Override
        public CookieStore getCookieStore() {
            return PersistentCookieStore.getInstance();
        }

        @Override
        public QRCodeUtil.QRQuality getQRQuality() {
            return UserPreference.getInstance().getQRQuality();
        }
    };
}
 
Example 8
Source File: AndroidImplAbstractApp.java    From bither-android with Apache License 2.0 4 votes vote down vote up
@Override
public ISetting initSetting() {
    return new ISetting() {
        @Override
        public BitherjSettings.AppMode getAppMode() {
            return AppSharedPreference.getInstance().getAppMode();
        }

        @Override
        public boolean getBitherjDoneSyncFromSpv() {
            return AppSharedPreference.getInstance().getBitherjDoneSyncFromSpv();
        }

        @Override
        public void setBitherjDoneSyncFromSpv(boolean isDone) {
            AppSharedPreference.getInstance().setBitherjDoneSyncFromSpv(isDone);
        }

        @Override
        public BitherjSettings.TransactionFeeMode getTransactionFeeMode() {
            return AppSharedPreference.getInstance().getTransactionFeeMode();
        }

        @Override
        public BitherjSettings.ApiConfig getApiConfig() {
            return AppSharedPreference.getInstance().getApiConfig();
        }

        @Override
        public File getPrivateDir(String dirName) {
            File file = BitherApplication.mContext.getDir(dirName, Context.MODE_PRIVATE);
            if (!file.exists()) {
                file.mkdirs();
            }
            return file;
        }

        @Override
        public boolean isApplicationRunInForeground() {
            if (BitherApplication.mContext == null) {
                return false;
            }
            ActivityManager am = (ActivityManager) BitherApplication.mContext
                    .getSystemService(Context.ACTIVITY_SERVICE);
            List<ActivityManager.RunningTaskInfo> tasks = am.getRunningTasks(1);
            if (tasks != null && !tasks.isEmpty()) {
                ComponentName topActivity = tasks.get(0).topActivity;
                if (!topActivity.getPackageName().equals(BitherApplication.mContext.getPackageName())) {
                    return false;
                }
                if (topActivity.getClassName().equals(AdActivity.class.getName())) {
                    return false;
                }
            }
            return true;
        }

        @Override
        public QRCodeUtil.QRQuality getQRQuality() {
            return AppSharedPreference.getInstance().getQRQuality();
        }

        @Override
        public boolean getDownloadSpvFinish() {
            return AppSharedPreference.getInstance().getDownloadSpvFinish();
        }

        @Override
        public void setDownloadSpvFinish(boolean finish) {
            AppSharedPreference.getInstance().setDownloadSpvFinish(finish);
        }

        @Override
        public CookieStore getCookieStore() {
            return PersistentCookieStore.getInstance();
        }


        
    };
}
 
Example 9
Source File: TestImplAbstractApp.java    From bitherj with Apache License 2.0 4 votes vote down vote up
@Override
public ISetting initSetting() {
    return new ISetting() {
        @Override
        public BitherjSettings.AppMode getAppMode() {
            return BitherjSettings.AppMode.HOT;
        }

        @Override
        public boolean getBitherjDoneSyncFromSpv() {
            return true;
        }

        @Override
        public void setBitherjDoneSyncFromSpv(boolean isDone) {
            // AppSharedPreference.getInstance().setBitherjDoneSyncFromSpv(isDone);
        }

        @Override
        public BitherjSettings.TransactionFeeMode getTransactionFeeMode() {
            return BitherjSettings.TransactionFeeMode.Low;
        }

        @Override
        public File getPrivateDir(String dirName) {
            File file = new File("test/wallet");
            if (!file.exists()) {
                file.mkdirs();
            }
            return file;
        }

        @Override
        public boolean isApplicationRunInForeground() {

            return true;
        }

        @Override
        public QRCodeUtil.QRQuality getQRQuality() {
            return QRCodeUtil.QRQuality.Normal;
        }

        @Override
        public boolean getDownloadSpvFinish() {
            return true;
        }

        @Override
        public void setDownloadSpvFinish(boolean finish) {
            // AppSharedPreference.getInstance().setDownloadSpvFinish(finish);
        }

        @Override
        public CookieStore getCookieStore() {
            return cookieStore;
        }


    };
}
 
Example 10
Source File: DesktopImplAbstractApp.java    From bither-desktop-java with Apache License 2.0 4 votes vote down vote up
@Override
public ISetting initSetting() {
    return new ISetting() {
        @Override
        public BitherjSettings.AppMode getAppMode() {
            return UserPreference.getInstance().getAppMode();
        }

        @Override
        public boolean getBitherjDoneSyncFromSpv() {
            return UserPreference.getInstance().getBitherjDoneSyncFromSpv();
        }

        @Override
        public void setBitherjDoneSyncFromSpv(boolean isDone) {
            UserPreference.getInstance().setBitherjDoneSyncFromSpv(isDone);
        }

        @Override
        public boolean getDownloadSpvFinish() {
            return UserPreference.getInstance().getDownloadSpvFinish();
        }

        @Override
        public void setDownloadSpvFinish(boolean finish) {
            UserPreference.getInstance().setDownloadSpvFinish(finish);

        }

        @Override
        public BitherjSettings.TransactionFeeMode getTransactionFeeMode() {
            return UserPreference.getInstance().getTransactionFeeMode();
        }

        @Override
        public File getPrivateDir(String dirName) {
            File file = new File(new ApplicationDataDirectoryLocator().getApplicationDataDirectory() + File.separator + dirName);
            if (!file.exists()) {
                file.mkdirs();
            }
            return file;
        }

        @Override
        public boolean isApplicationRunInForeground() {

            return true;
        }

        @Override
        public CookieStore getCookieStore() {
            return PersistentCookieStore.getInstance();
        }

        @Override
        public QRCodeUtil.QRQuality getQRQuality() {
            return UserPreference.getInstance().getQRQuality();
        }
    };
}
 
Example 11
Source File: ISetting.java    From bitherj with Apache License 2.0 votes vote down vote up
public abstract QRCodeUtil.QRQuality getQRQuality();