| | |
| | | import android.app.Activity; |
| | | import android.content.Context; |
| | | import android.content.Intent; |
| | | import android.content.SharedPreferences; |
| | | import android.graphics.Color; |
| | | import android.graphics.drawable.Drawable; |
| | | import android.graphics.drawable.GradientDrawable; |
| | |
| | | return "今日销"; |
| | | default: |
| | | return "总销"; |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 是否展开红包/返利详情 |
| | | * |
| | | * @param context |
| | | * @return |
| | | */ |
| | | public static boolean spreadHoneBaoOrFanLiDetail(Context context) { |
| | | SharedPreferences sharedPreferences = context.getSharedPreferences("goods", Context.MODE_PRIVATE); |
| | | long time = sharedPreferences.getLong("installTime", 0L); |
| | | if (System.currentTimeMillis() - time < 1000 * 60 * 60 * 24L * 3) { |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 初始化安装时间 |
| | | * |
| | | * @param context |
| | | */ |
| | | public static void initInstallTime(Context context) { |
| | | SharedPreferences sharedPreferences = context.getSharedPreferences("goods", Context.MODE_PRIVATE); |
| | | long installTime = sharedPreferences.getLong("installTime", 0L); |
| | | if (installTime == 0L) { |
| | | SharedPreferences.Editor editor = sharedPreferences.edit(); |
| | | editor.putLong("installTime", System.currentTimeMillis()); |
| | | editor.commit(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 是否需要提醒登录返利 |
| | | * |
| | | * @param context |
| | | * @return |
| | | */ |
| | | public static boolean needNotifyLoginFanli(Context context) { |
| | | SharedPreferences sharedPreferences = context.getSharedPreferences("goods", Context.MODE_PRIVATE); |
| | | boolean notifyLoginFanli = sharedPreferences.getBoolean("notifyLoginFanli", true); |
| | | return notifyLoginFanli; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 已经提醒了登录返利 |
| | | * |
| | | * @param context |
| | | */ |
| | | public static void alreadyNotifyLoginFanli(Context context) { |
| | | SharedPreferences sharedPreferences = context.getSharedPreferences("goods", Context.MODE_PRIVATE); |
| | | SharedPreferences.Editor editor = sharedPreferences.edit(); |
| | | editor.putBoolean("notifyLoginFanli", false); |
| | | editor.commit(); |
| | | } |
| | | |
| | | |
| | | } |