use of ingage.ingage.managers.SessionManager in project iNGAGE by davis123123.
the class ContactUsActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_contact_us);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setTitle(getResources().getString(R.string.contact_us_title));
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setHomeButtonEnabled(true);
session = new SessionManager(this);
HashMap<String, String> user = session.getUserDetails();
final String email = user.get(SessionManager.KEY_EMAIL);
// etSender = (EditText) findViewById(R.id.et_email_sender);
etSubject = (EditText) findViewById(R.id.et_email_title);
etMessage = (EditText) findViewById(R.id.et_email_content);
btnEmailUs = (Button) findViewById(R.id.btnEmailUs);
btnEmailUs.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String subject = String.valueOf(etSubject.getText());
String message = String.valueOf(etMessage.getText());
if (etSubject.getText().length() == 0) {
Toast.makeText(ContactUsActivity.this, "Please enter subject line", Toast.LENGTH_SHORT).show();
} else if (etMessage.getText().length() == 0) {
Toast.makeText(ContactUsActivity.this, "Please enter your message", Toast.LENGTH_SHORT).show();
} else {
loadingDialog();
String type = "submit";
ContactUsHandler contactUsHandler = new ContactUsHandler(ContactUsActivity.this);
contactUsHandler.execute(type, email, subject, message);
}
}
});
}
use of ingage.ingage.managers.SessionManager 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);
cbRemember = (CheckBox) findViewById(R.id.cbRememberMe);
cbRemember.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
String key = getResources().getString(R.string.remember_user_checked);
SharedPreferences.Editor prefEditor = PreferenceManager.getDefaultSharedPreferences(getBaseContext()).edit();
if (cbRemember.isChecked()) {
prefEditor.putBoolean(key, true);
} else {
prefEditor.putBoolean(key, false);
}
prefEditor.commit();
}
});
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();
}
}
});
loadUserName();
showEULA();
}
use of ingage.ingage.managers.SessionManager in project iNGAGE by davis123123.
the class PostCommentActivity method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_post_comment);
session = new SessionManager(getApplicationContext());
sidesSpinner = (Spinner) findViewById(R.id.spinner);
mInsertComment = (EditText) findViewById(R.id.comment_edit_text);
addListenerOnSpinnerItemSelection();
}
use of ingage.ingage.managers.SessionManager in project iNGAGE by davis123123.
the class ChatFragment method onCreateView.
@Override
public View onCreateView(final LayoutInflater inflater, final ViewGroup container, final Bundle savedInstanceState) {
View v = create(inflater, container, savedInstanceState);
// thread id for root of comments tree
// getuser details
chatRoomManager = new ChatRoomManager(getContext());
HashMap<String, String> chat = chatRoomManager.getUserDetails();
thread_id = chat.get(ChatRoomManager.THREAD_ID);
user_side = chat.get(ChatRoomManager.SIDE);
root = FirebaseDatabase.getInstance().getReference().child(thread_id);
session = new SessionManager(getContext());
HashMap<String, String> user = session.getUserDetails();
username = user.get(SessionManager.KEY_NAME);
username = user.get(SessionManager.KEY_NAME);
return v;
}
use of ingage.ingage.managers.SessionManager in project iNGAGE by davis123123.
the class PostThreadActivity method onCreate.
@Override
protected void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
session = new SessionManager(getApplicationContext());
setContentView(R.layout.activity_post_thread);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setHomeButtonEnabled(true);
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
thread = new ThreadsHelper();
rlPage1 = (RelativeLayout) findViewById(R.id.rlPage1);
rlPage2 = (RelativeLayout) findViewById(R.id.rlPage2);
mInsertThreadContent = (EditText) findViewById(R.id.insert_thread_content_text_view);
mInsertThreadTitle = (EditText) findViewById(R.id.insert_thread_title_text_view);
imageToUpload = (ImageView) findViewById(R.id.uploadImageView);
llUploadImage = (LinearLayout) findViewById(R.id.llUploadImage);
btnCategorySpinner = (Button) findViewById(R.id.btnCategorySpinner);
btnNext = (Button) findViewById(R.id.btnNext);
btnSubmit = (Button) findViewById(R.id.btnSubmit);
ivIcon1 = (ImageView) findViewById(R.id.ivIcon1);
ivIcon2 = (ImageView) findViewById(R.id.ivIcon2);
Resources res = getResources();
activeColor = res.getColor(R.color.colorPrimary);
inactiveColor = res.getColor(R.color.gray);
ivIcon1.setColorFilter(activeColor, PorterDuff.Mode.SRC_ATOP);
ivIcon2.setColorFilter(inactiveColor, PorterDuff.Mode.SRC_ATOP);
btnCategorySpinner.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
FragmentManager fm = getFragmentManager();
f = ListDialogFragment.newInstance();
f.show(fm, "");
}
});
btnNext.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String threadContent = mInsertThreadContent.getText().toString();
String threadTitle = mInsertThreadTitle.getText().toString();
String cSpinner = (String) btnCategorySpinner.getText();
// USER INSERT
HashMap<String, String> user = session.getUserDetails();
String threadBy = user.get(SessionManager.KEY_NAME);
thread.setThread_title(threadTitle);
thread.setThread_content(threadContent);
thread.setThread_category(cSpinner);
thread.setThread_by(threadBy);
if (threadTitle.length() == 0) {
Toast.makeText(PostThreadActivity.this, "Please provide a title.", Toast.LENGTH_SHORT).show();
return;
}
if (threadContent.length() == 0) {
Toast.makeText(PostThreadActivity.this, "Please provide a description", Toast.LENGTH_SHORT).show();
return;
}
if (btnCategorySpinner.getText().equals(getResources().getString(R.string.category_default)) || btnCategorySpinner.getText() == null) {
Toast.makeText(PostThreadActivity.this, "Please select a category", Toast.LENGTH_SHORT).show();
return;
}
ivIcon2.setColorFilter(activeColor, PorterDuff.Mode.SRC_ATOP);
rlPage1.setVisibility(View.GONE);
rlPage2.setVisibility(View.VISIBLE);
}
});
btnSubmit.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String imageTitle = thread.getThread_title().replaceAll("\\s+", "");
// submit image
if (usedImage) {
image = ((BitmapDrawable) imageToUpload.getDrawable()).getBitmap();
image_link = "http://107.170.232.60/images/" + imageTitle + ".JPG";
}
showConfirmationDialog();
}
});
imageToUpload.setVisibility(View.INVISIBLE);
setUploadImageLayout();
llUploadImage.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
goUploadImage();
}
});
imageToUpload.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
goUploadImage();
}
});
}
Aggregations