package com.yeshi.makemoney.video.app.utils.videos;
|
|
import android.content.Context;
|
import android.content.SharedPreferences;
|
|
public class NovelGoldCornUtil {
|
|
|
/**
|
* 获取小说阅读时间
|
*
|
* @param context
|
* @return
|
*/
|
public static long getReadTime(Context context) {
|
SharedPreferences sharedPreferences = context.getSharedPreferences("novel_goldcorn", Context.MODE_PRIVATE);
|
return sharedPreferences.getLong("duration", 0L);
|
}
|
|
/**
|
* 设置小说阅读时间
|
*
|
* @param duration
|
* @param context
|
*/
|
public static void setReadTime(long duration, Context context) {
|
SharedPreferences sharedPreferences = context.getSharedPreferences("news_goldcorn", Context.MODE_PRIVATE);
|
SharedPreferences.Editor editor = sharedPreferences.edit();
|
editor.putLong("duration", duration);
|
editor.commit();
|
}
|
|
|
}
|