use of com.a5corp.weather.preferences.Prefs in project Weather by Sparker0i.
the class FirstLaunch method attachBaseContext.
@Override
protected void attachBaseContext(Context newBase) {
Context context = MyContextWrapper.wrap(newBase, new Prefs(newBase).getLanguage());
super.attachBaseContext(context);
}
use of com.a5corp.weather.preferences.Prefs in project Weather by Sparker0i.
the class WeatherActivity method attachBaseContext.
@Override
protected void attachBaseContext(Context newBase) {
Context context = MyContextWrapper.wrap(newBase, new Prefs(newBase).getLanguage());
super.attachBaseContext(context);
}
use of com.a5corp.weather.preferences.Prefs in project Weather by Sparker0i.
the class WeatherActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_weather);
Log.i("Activity", WeatherActivity.class.getSimpleName());
mManager = NotificationManagerCompat.from(this);
preferences = new Prefs(this);
toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
fab = findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
hideFab();
showInputDialog();
}
});
Intent intent = getIntent();
handler = new Handler();
fab.show();
wf = new WeatherFragment();
Bundle bundle = new Bundle();
bundle.putInt("mode", intent.getIntExtra(Constants.MODE, 0));
wf.setArguments(bundle);
gf = new GraphsFragment();
// mf = new MapsFragment();
dbHelper = new DBHelper(this);
getSupportFragmentManager().beginTransaction().replace(R.id.fragment, wf).commit();
initDrawer();
NotificationService.enqueueWork(this, new Intent(this, WeatherActivity.class));
}
use of com.a5corp.weather.preferences.Prefs in project Weather by Sparker0i.
the class SettingsActivity method attachBaseContext.
@Override
protected void attachBaseContext(Context newBase) {
Context context = MyContextWrapper.wrap(newBase, new Prefs(newBase).getLanguage());
super.attachBaseContext(context);
}
use of com.a5corp.weather.preferences.Prefs in project Weather by Sparker0i.
the class GlobalActivity method onResume.
@Override
protected void onResume() {
cp = new Preferences(this);
prefs = new Prefs(this);
super.onResume();
if (!cp.getPrefs().getBoolean("first", true)) {
prefs.setLaunched();
prefs.setCity(cp.getCity());
}
super.onResume();
Intent intent;
if (prefs.getLaunched()) {
intent = new Intent(GlobalActivity.this, WeatherActivity.class);
} else {
intent = new Intent(GlobalActivity.this, FirstLaunch.class);
}
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
startActivity(intent);
}
Aggregations