remove useless content

This commit is contained in:
inxtes
2021-12-29 16:21:34 +08:00
parent b900d36df3
commit 5a17216fff
12 changed files with 158 additions and 51 deletions
@@ -26,18 +26,11 @@ class LoginActivity : AppCompatActivity() {
setContentView(R.layout.activity_login)
val login = findViewById<FloatingActionButton>(R.id.login)
AlertDialog.Builder(this).apply {
setMessage("目前阶段登录没有任何实质的用处,仅会保存你输入的用户名用于搜索你的收藏夹,而通过登录获取到的Cookie在将来可能会有实质的用处,Cookie将不会保存,如你不需要使用收藏夹,请直接点击登录按钮。")
setTitle("关于登录")
setPositiveButton("确定"){it,_->
it.dismiss()
}
}.create().show()
login.setOnClickListener {
val username = findViewById<EditText>(R.id.username)
val password = findViewById<EditText>(R.id.password)
val sPassword = "choujin-steiner--${password.text.toString()}--"
val sPassword = "choujin-steiner--${password.text}--"
val hash1Password = StrToHash1.shaEncrypt(sPassword)
thread {
conn(username.text.toString(),hash1Password)
@@ -23,9 +23,9 @@ public class StrToHash1 {
private static String bytes2Hex(byte[] bts){
StringBuilder des = new StringBuilder();
String tmp = null;
for (int i =0;i<bts.length;i++){
tmp = Integer.toHexString(bts[i] & 0xFF);
if (tmp.length()==1){
for (byte bt : bts) {
tmp = Integer.toHexString(bt & 0xFF);
if (tmp.length() == 1) {
des.append("0");
}
des.append(tmp);
@@ -101,19 +101,11 @@ class MainActivity : AppCompatActivity() {
loadPost(this, null, searchTag,nowPage.toString())
}
//登录
/**
name.setOnClickListener {
val intent = Intent(this,LoginActivity::class.java)
startActivity(intent)
}*/
//侧边栏
val sp = getSharedPreferences("username",0)
username = sp.getString("username",null)
// val headerView = LayoutInflater.from(this).inflate(R.layout.nav_header,null)
// val name = headerView.findViewById<TextView>(R.id.name)
// name.text= username
val nav = findViewById<NavigationView>(R.id.nav)
val headerView = nav.getHeaderView(0)
@@ -134,13 +126,9 @@ class MainActivity : AppCompatActivity() {
Log.e("touch","touch2")
if (username == null) {
alterEditDialog()
postList.clear()
loadPost(this,null,"vote:3:$username order:vote","1")
}else{
postList.clear()
Log.e("username","true")
loadPost(this,null,"vote:3:$username order:vote","1")
}
postList.clear()
loadPost(this,null,"vote:3:$username order:vote","1")
drawerLayout.closeDrawers()
true
}
@@ -280,10 +268,8 @@ class MainActivity : AppCompatActivity() {
})
swipeRefreshLayout.isRefreshing = false
}
})
@@ -32,7 +32,7 @@ class SizeAdapter(val tagList: List<Size>):RecyclerView.Adapter<SizeAdapter.View
val format = DecimalFormat("0.##")
format.roundingMode = RoundingMode.FLOOR
val size = format.format(sizeKb)
holder.tagText.text = "$size Kb"
holder.tagText.text = "$size KB"
}
}