Search in sources :

Example 1 with WifiManager

use of ingage.ingage20.managers.WifiManager in project iNGAGE by davis123123.

the class LoginActivity method onCreate.

// String thread_subs;
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_sign_in);
    session = new SessionManager(getApplicationContext());
    wifiManager = new WifiManager(getBaseContext());
    usernameEt = (EditText) findViewById(R.id.username);
    passwordEt = (EditText) findViewById(R.id.password);
    LoginEt = (Button) findViewById(R.id.sign_in_button);
    signUpTV = (TextView) findViewById(R.id.signIn_textView_CreateNewAccount);
    signUpTV.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            if (wifiManager.checkInternet())
                goSignUp();
            else
                wifiErrorDialog();
        }
    });
    LoginEt.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            if (view == LoginEt) {
                if (wifiManager.checkInternet())
                    OnLogin();
                else
                    wifiErrorDialog();
            }
        }
    });
}
Also used : WifiManager(ingage.ingage20.managers.WifiManager) SessionManager(ingage.ingage20.managers.SessionManager) View(android.view.View) TextView(android.widget.TextView)

Example 2 with WifiManager

use of ingage.ingage20.managers.WifiManager in project iNGAGE by davis123123.

the class MainActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mContext = getApplicationContext();
    session = new SessionManager(mContext);
    session.checkLogin();
    setContentView(R.layout.activity_main);
    setupToolbar(savedInstanceState);
    /**
     *RecyclerView (TEMPORARY, MOVE TO A FRAGMENT LATER)*
     */
    ListView lvItems;
    wifiManager = new WifiManager(getBaseContext());
    if (wifiManager.checkInternet()) {
        parseJSON();
        setupNavigationMenu(savedInstanceState);
        setupNavigationDrawer();
        session.updatePage(pageType);
        /* initilize FrontPage Fragment*/
        fragmentManager = this.getSupportFragmentManager();
        final Class fragmentClass = FrontPageFragment.class;
        final Fragment fragment = Fragment.instantiate(this, fragmentClass.getName());
        fragmentManager.beginTransaction().replace(R.id.main_fragment_container, fragment, fragmentClass.getSimpleName()).setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN).commit();
        initTabs();
        initAnnouncement();
    }
    // Set the title for the fragment.
    final ActionBar actionBar = this.getSupportActionBar();
    if (actionBar != null) {
        actionBar.setTitle(getString(R.string.app_name));
    }
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    UserProfileActivity.recentComments.clear();
// viewPager = (ViewPager) findViewById(R.id.viewpager);
// setupViewPager(viewPager);
// tabLayout.setupWithViewPager(viewPager);
}
Also used : WifiManager(ingage.ingage20.managers.WifiManager) ListView(android.widget.ListView) FrontPageFragment(ingage.ingage20.fragments.FrontPageFragment) SessionManager(ingage.ingage20.managers.SessionManager) FrontPageFragment(ingage.ingage20.fragments.FrontPageFragment) Fragment(android.support.v4.app.Fragment) CategoriesPageFragment(ingage.ingage20.fragments.CategoriesPageFragment) SearchResultFragment(ingage.ingage20.fragments.SearchResultFragment) ActionBar(android.support.v7.app.ActionBar)

Example 3 with WifiManager

use of ingage.ingage20.managers.WifiManager in project iNGAGE by davis123123.

the class SignUpActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_sign_up);
    mFullName = (EditText) findViewById(R.id.sign_up_full_name);
    mUserName = (EditText) findViewById(R.id.sign_up_username);
    mPassword = (EditText) findViewById(R.id.sign_up_password);
    mRePassword = (EditText) findViewById(R.id.retype_password);
    mEmail = (EditText) findViewById(R.id.sign_up_email);
    mSignUp = (Button) findViewById(R.id.sign_up_button);
    wifiManager = new WifiManager(getBaseContext());
    mSignUp.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            if (view == mSignUp) {
                if (wifiManager.checkInternet())
                    onRegister();
                else
                    wifiErrorDialog();
            }
        }
    });
}
Also used : WifiManager(ingage.ingage20.managers.WifiManager) View(android.view.View)

Aggregations

WifiManager (ingage.ingage20.managers.WifiManager)3 View (android.view.View)2 SessionManager (ingage.ingage20.managers.SessionManager)2 Fragment (android.support.v4.app.Fragment)1 ActionBar (android.support.v7.app.ActionBar)1 ListView (android.widget.ListView)1 TextView (android.widget.TextView)1 CategoriesPageFragment (ingage.ingage20.fragments.CategoriesPageFragment)1 FrontPageFragment (ingage.ingage20.fragments.FrontPageFragment)1 SearchResultFragment (ingage.ingage20.fragments.SearchResultFragment)1