Search in sources :

Example 6 with PrefManager

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 */
    }
}
Also used : HummingbirdApi(tr.bcxip.hummingbird.api.HummingbirdApi) PrefManager(tr.bcxip.hummingbird.managers.PrefManager)

Example 7 with PrefManager

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();
}
Also used : Bundle(android.os.Bundle) PrefManager(tr.bcxip.hummingbird.managers.PrefManager)

Example 8 with PrefManager

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();
}
Also used : HummingbirdApi(tr.bcxip.hummingbird.api.HummingbirdApi) PrefManager(tr.bcxip.hummingbird.managers.PrefManager)

Example 9 with PrefManager

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();
        }
    });
}
Also used : HummingbirdApi(tr.bcxip.hummingbird.api.HummingbirdApi) TextWatcher(android.text.TextWatcher) Editable(android.text.Editable) TextView(android.widget.TextView) View(android.view.View) PrefManager(tr.bcxip.hummingbird.managers.PrefManager)

Example 10 with PrefManager

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;
    }
}
Also used : SharedPreferences(android.content.SharedPreferences) HummingbirdApi(tr.bcxip.hummingbird.api.HummingbirdApi) PrefManager(tr.bcxip.hummingbird.managers.PrefManager)

Aggregations

PrefManager (tr.bcxip.hummingbird.managers.PrefManager)11 HummingbirdApi (tr.bcxip.hummingbird.api.HummingbirdApi)8 View (android.view.View)2 TextView (android.widget.TextView)2 TargetApi (android.annotation.TargetApi)1 Intent (android.content.Intent)1 SharedPreferences (android.content.SharedPreferences)1 Outline (android.graphics.Outline)1 ColorDrawable (android.graphics.drawable.ColorDrawable)1 Bundle (android.os.Bundle)1 Editable (android.text.Editable)1 TextWatcher (android.text.TextWatcher)1 Transition (android.transition.Transition)1 ViewOutlineProvider (android.view.ViewOutlineProvider)1 ViewTreeObserver (android.view.ViewTreeObserver)1 AdapterView (android.widget.AdapterView)1 ImageView (android.widget.ImageView)1 Anime (tr.bcxip.hummingbird.api.objects.Anime)1 LibraryEntry (tr.bcxip.hummingbird.api.objects.LibraryEntry)1 ObservableScrollView (tr.bcxip.hummingbird.widget.ObservableScrollView)1