use of com.instructure.pandautils.utils.Prefs in project instructure-android by instructure.
the class WeekFragment method onCreateView.
// Sync
@Override
public void onCreateView(View view) {
ButterKnife.bind(this, view);
// set the color of the weekBackground
Prefs prefs = new Prefs(getActivity(), com.instructure.parentapp.util.Const.CANVAS_PARENT_SP);
int color = prefs.load(Const.NEW_COLOR, -1);
if (color != -1) {
mWeekBackground.setBackgroundColor(color);
}
if (mToolbar != null) {
mToolbar.setVisibility(View.VISIBLE);
mToolbar.setNavigationIcon(R.drawable.ic_close_white);
mToolbar.setNavigationContentDescription(R.string.close);
mToolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
getActivity().onBackPressed();
}
});
if (color != -1) {
setStatusBarColor(color);
setActionbarColor(color);
}
}
}
use of com.instructure.pandautils.utils.Prefs in project instructure-android by instructure.
the class RoboTesting method setAppStatePrefs.
static void setAppStatePrefs(Context context) {
// save parent id and user name
Prefs prefs = new Prefs(context, context.getString(R.string.app_name_parent));
prefs.save(com.instructure.pandautils.utils.Const.ID, BuildConfig.ROBO_TEST_USER_ID);
prefs.save(com.instructure.pandautils.utils.Const.NAME, BuildConfig.ROBO_TEST_USERNAME);
// save token
ApiPrefs.setToken(BuildConfig.ROBO_TEST_API_KEY);
// Set domain to gamma
ApiPrefs.setAirwolfDomain(BuildConfig.GAMMA_DOMAIN);
}
Aggregations