use of tr.bcxip.hummingbird.managers.PrefManager in project Hummingbird-for-Android by xiprox.
the class FeedFragment method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
context = getActivity();
api = new HummingbirdApi(context);
prefMan = new PrefManager(context);
try {
parent = (ProfileFragment) getFragmentManager().findFragmentByTag(ProfileFragment.FRAGMENT_TAG_PROFILE);
} catch (Exception e) {
/* empty */
}
}
use of tr.bcxip.hummingbird.managers.PrefManager in project Hummingbird-for-Android by xiprox.
the class LibraryFragment method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
context = getActivity();
prefMan = new PrefManager(context);
/* Check if any username argument is passed. If one is passed, load the library for it;
* if not, load for the currently logged in user.
* */
Bundle args = getArguments();
String argUsername = args != null ? args.getString(ARG_USERNAME) : null;
username = argUsername != null ? argUsername : prefMan.getUsername();
}
use of tr.bcxip.hummingbird.managers.PrefManager in project Hummingbird-for-Android by xiprox.
the class LibraryTabFragment method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
context = getActivity();
api = new HummingbirdApi(context);
prefMan = new PrefManager(context);
USERNAME = getArguments().getString(ARG_USERNAME);
AUTH_TOKEN = prefMan.getAuthToken();
}
use of tr.bcxip.hummingbird.managers.PrefManager in project Hummingbird-for-Android by xiprox.
the class LoginActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
api = new HummingbirdApi(this);
prefMan = new PrefManager(this);
mUsername = (EditText) findViewById(R.id.edit_username);
mPassword = (EditText) findViewById(R.id.edit_password);
mSignIn = (Button) findViewById(R.id.btn_login);
mSignUp = (Button) findViewById(R.id.btn_new);
mHelp = (Button) findViewById(R.id.btn_help);
mErrorMessage = (TextView) findViewById(R.id.error_text);
mProgressBar = (ProgressBar) findViewById(R.id.login_progress_bar);
mSignIn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
new AuthenticationTask().executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
});
mSignUp.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
sendLink(2);
}
});
mHelp.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
sendLink(1);
}
});
mUsername.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
/* empty */
}
@Override
public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
/* empty */
}
@Override
public void afterTextChanged(Editable editable) {
updateState();
}
});
mPassword.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
/* empty */
}
@Override
public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
/* empty */
}
@Override
public void afterTextChanged(Editable editable) {
updateState();
}
});
}
use of tr.bcxip.hummingbird.managers.PrefManager in project Hummingbird-for-Android by xiprox.
the class NavigationDrawerFragment method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
context = getActivity();
api = new HummingbirdApi(context);
prefMan = new PrefManager(context);
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(getActivity());
mUserLearnedDrawer = sp.getBoolean(PREF_USER_LEARNED_DRAWER, false);
if (savedInstanceState != null) {
mCurrentSelectedPosition = savedInstanceState.getInt(STATE_SELECTED_POSITION);
mFromSavedInstanceState = true;
}
}
Aggregations