use of com.a5corp.weather.preferences.Prefs in project Weather by Sparker0i.
the class AppCompatPreferenceActivity 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 AlarmTriggerService method onHandleIntent.
@Override
protected void onHandleIntent(Intent intent) {
preferences = new Prefs(this);
if (preferences.getNotifs()) {
Intent myIntent = new Intent(this, MyReceiver.class);
pendingIntent = PendingIntent.getBroadcast(this, 0, myIntent, PendingIntent.FLAG_UPDATE_CURRENT);
AlarmManager am = (AlarmManager) this.getSystemService(Context.ALARM_SERVICE);
am.setInexactRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP, SystemClock.elapsedRealtime(), AlarmManager.INTERVAL_HOUR, pendingIntent);
}
}
use of com.a5corp.weather.preferences.Prefs in project Weather by Sparker0i.
the class CustomBottomSheetDialogFragment method onCreateView.
@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
rootView = inflater.inflate(R.layout.dialog_modal, container, false);
condition = rootView.findViewById(R.id.description);
preferences = new Prefs(getContext());
nightValue = rootView.findViewById(R.id.night_temperature);
mornValue = rootView.findViewById(R.id.morning_temperature);
dayValue = rootView.findViewById(R.id.day_temperature);
eveValue = rootView.findViewById(R.id.evening_temperature);
windIcon = rootView.findViewById(R.id.wind_icon);
windIcon.setTypeface(weatherFont);
windIcon.setText(getString(R.string.speed_icon));
rainIcon = rootView.findViewById(R.id.rain_icon);
rainIcon.setTypeface(weatherFont);
rainIcon.setText(getString(R.string.rain));
snowIcon = rootView.findViewById(R.id.snow_icon);
snowIcon.setTypeface(weatherFont);
snowIcon.setText(getString(R.string.snow));
humidityIcon = rootView.findViewById(R.id.humidity_icon);
humidityIcon.setTypeface(weatherFont);
humidityIcon.setText(getString(R.string.humidity_icon));
pressureIcon = rootView.findViewById(R.id.pressure_icon);
pressureIcon.setTypeface(weatherFont);
pressureIcon.setText(getString(R.string.pressure_icon));
windText = rootView.findViewById(R.id.wind);
rainText = rootView.findViewById(R.id.rain);
snowText = rootView.findViewById(R.id.snow);
humidityText = rootView.findViewById(R.id.humidity);
pressureText = rootView.findViewById(R.id.pressure);
updateElements();
return rootView;
}
use of com.a5corp.weather.preferences.Prefs in project Weather by Sparker0i.
the class GraphsFragment method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mValueFormatter = new CustomFormatter();
pf = new Prefs(getContext());
setHasOptionsMenu(true);
}
use of com.a5corp.weather.preferences.Prefs in project Weather by Sparker0i.
the class GraphsFragment method getDay.
public String getDay(long dt) {
dt *= 1000;
Calendar c = Calendar.getInstance();
c.setTime(new Date(dt));
return c.getDisplayName(Calendar.DAY_OF_WEEK, Calendar.SHORT, new Locale(new Prefs(getActivity()).getLanguage()));
}
Aggregations