use of io.spark.core.android.util.NetConnectionHelper in project android-app by spark.
the class SmartConfigFragment method onAttach.
@Override
public void onAttach(Activity activity) {
super.onAttach(activity);
wifiHelper = new NetConnectionHelper(activity);
receiver = new SmartConfigFoundSomethingReceiver();
failHandler = new Handler();
smartConfigFailedRunnable = new Runnable() {
@Override
public void run() {
getActivity().startActivity(new Intent(getActivity(), NoCoresFoundActivity.class));
getActivity().finish();
}
};
}
use of io.spark.core.android.util.NetConnectionHelper in project android-app by spark.
the class LoginActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_log_in);
mEmailView = Ui.findView(this, R.id.email);
mPasswordView = Ui.findView(this, R.id.password);
mEmailView.setText(prefs.getUsername());
netConnectionHelper = new NetConnectionHelper(this);
mPasswordView.setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView textView, int id, KeyEvent keyEvent) {
if (id == R.id.login || id == EditorInfo.IME_NULL) {
attemptLogin();
return true;
}
return false;
}
});
accountAction = Ui.findView(this, R.id.sign_up_button);
accountAction.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
attemptLogin();
}
});
// keyboard pops up
for (View view : list(mEmailView, mPasswordView)) {
view.setOnTouchListener(new OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
if (event.getAction() == MotionEvent.ACTION_UP) {
scrollAccountForm();
}
return false;
}
});
}
TextView noAccountYet = Ui.setTextFromHtml(this, R.id.no_account_yet, R.string.i_dont_have_an_account);
noAccountYet.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
launchSignUpActivity();
}
});
TextView forgotPassword = Ui.setTextFromHtml(this, R.id.forgot_password, R.string.action_forgot_password);
forgotPassword.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
openUri(R.string.uri_forgot_password);
}
});
}
Aggregations