lets not redefine the mConfig of SimpleActivity

This commit is contained in:
tibbi 2016-10-17 22:07:00 +02:00
parent d61f139cce
commit 5060d2b893
3 changed files with 2 additions and 7 deletions

View File

@ -11,7 +11,6 @@ import android.view.View;
import android.widget.TextView;
import com.simplemobiletools.calendar.BuildConfig;
import com.simplemobiletools.calendar.Config;
import com.simplemobiletools.calendar.R;
import java.util.Calendar;
@ -55,7 +54,7 @@ public class AboutActivity extends SimpleActivity {
}
private void setupRateUs() {
if (Config.newInstance(getApplicationContext()).getIsFirstRun()) {
if (mConfig.getIsFirstRun()) {
mRateUs.setVisibility(View.GONE);
}
}

View File

@ -4,7 +4,6 @@ import android.os.Bundle;
import android.support.v4.app.TaskStackBuilder;
import android.support.v7.widget.SwitchCompat;
import com.simplemobiletools.calendar.Config;
import com.simplemobiletools.calendar.R;
import butterknife.BindView;
@ -16,13 +15,10 @@ public class SettingsActivity extends SimpleActivity {
@BindView(R.id.settings_sunday_first) SwitchCompat mSundayFirstSwitch;
@BindView(R.id.settings_week_numbers) SwitchCompat mWeekNumbersSwitch;
private static Config mConfig;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_settings);
mConfig = Config.newInstance(getApplicationContext());
ButterKnife.bind(this);
setupDarkTheme();

View File

@ -33,7 +33,7 @@ class MainActivity : SimpleActivity(), NavigationListener {
override fun onDestroy() {
super.onDestroy()
Config.newInstance(applicationContext).isFirstRun = false
mConfig.isFirstRun = false
}
override fun onCreateOptionsMenu(menu: Menu): Boolean {