2.5日 Andriod 记账本开发

//点击眼睛时,如果是明文就加密,如果是密文,就变成明文
private void toggleShow() {
if (isShow) {
PasswordTransformationMethod passwordMethod = PasswordTransformationMethod.getInstance();
topInTv.setTransformationMethod(passwordMethod);
topOutTv.setTransformationMethod(passwordMethod);
topbudgetTv.setTransformationMethod(passwordMethod);
topShowIv.setImageResource(R.mipmap.ih_hide);
isShow = false;
} else {
HideReturnsTransformationMethod hideReturnsTransformationMethod = HideReturnsTransformationMethod.getInstance();
topInTv.setTransformationMethod(hideReturnsTransformationMethod);
topOutTv.setTransformationMethod(hideReturnsTransformationMethod);
topbudgetTv.setTransformationMethod(hideReturnsTransformationMethod);
topShowIv.setImageResource(R.mipmap.ih_show);
isShow = true;
}
}
 
private void showBudgetDialog() {
//显示设置预算对话框
BudgetDialog dialog = new BudgetDialog(this);
dialog.show();
dialog.setOnEnsureListener(money -> {
//将金额写入共享参数中,进行存储
SharedPreferences.Editor editor = preferences.edit();
editor.putFloat("bmoney", money);
editor.commit();
//计算剩余金额
float outComeMonth = DBManager.getMoneyOneMonth(year, month, 0);
float sMoney = money - outComeMonth;//预算剩余
topbudgetTv.setText("¥ " + sMoney);
});
}
posted @   new菜鸟  阅读(5)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· .NET10 - 预览版1新功能体验(一)
点击右上角即可分享
微信分享提示