|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
package cc.liuyx.note.activity;
|
|
|
|
|
|
|
|
|
|
import android.annotation.SuppressLint;
|
|
|
|
|
import android.app.Activity;
|
|
|
|
|
import android.content.BroadcastReceiver;
|
|
|
|
|
import android.content.Context;
|
|
|
|
@ -21,6 +22,7 @@ import com.githang.statusbar.StatusBarCompat;
|
|
|
|
|
|
|
|
|
|
import java.text.ParseException;
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
|
import java.util.Objects;
|
|
|
|
|
|
|
|
|
|
public abstract class BaseActivity extends AppCompatActivity {
|
|
|
|
|
|
|
|
|
@ -59,7 +61,6 @@ public abstract class BaseActivity extends AppCompatActivity {
|
|
|
|
|
public void setNightMode(){
|
|
|
|
|
if(isNightMode()) this.setTheme(R.style.NightTheme);
|
|
|
|
|
else setTheme(R.style.DayTheme);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected abstract void needRefresh();
|
|
|
|
@ -71,8 +72,7 @@ public abstract class BaseActivity extends AppCompatActivity {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public long calStrToSec(String date) throws ParseException {//decode calender date to second
|
|
|
|
|
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
|
|
|
|
long secTime = format.parse(date).getTime();
|
|
|
|
|
return secTime;
|
|
|
|
|
@SuppressLint("SimpleDateFormat") SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
|
|
|
|
return Objects.requireNonNull(format.parse(date)).getTime();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|