Skip to content

Commit

Permalink
🎉Release 1.3,长按新UI文字标题可修改背景图片(BETA)
Browse files Browse the repository at this point in the history
🎉Release 1.3,长按新UI文字标题可修改背景图片(BETA)
  • Loading branch information
Hny0305Lin authored Jul 8, 2024
2 parents 0d619eb + c77d0a6 commit 0d53f69
Showing 1 changed file with 36 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/* 受Haohanyh Computer Software Products Open Source LICENSE保护 https://github.com/Hny0305Lin/LICENSE/blob/main/LICENSE */
package com.haohanyh.linmengjia.nearlink.nlchat.fun.ChatCore;

import android.content.Context;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;

public class ChatFileUtils {
private static final String FILE_NAME = "background_path.txt";

public static void saveBackgroundPath(Context context, String path) {
File file = new File(context.getFilesDir(), FILE_NAME);
try (FileWriter writer = new FileWriter(file)) {
writer.write(path);
} catch (IOException e) {
e.printStackTrace();
}
}

public static String getBackgroundPath(Context context) {
File file = new File(context.getFilesDir(), FILE_NAME);
if (!file.exists()) {
return null;
}
try (BufferedReader reader = new BufferedReader(new FileReader(file))) {
return reader.readLine();
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
}

0 comments on commit 0d53f69

Please sign in to comment.