use of ingage.ingage20.managers.SessionManager in project iNGAGE by davis123123.
the class SearchResultFragment method getThreadsJSON.
public void getThreadsJSON(int rowCount, String searchString) {
searchHandler = new SearchHandler();
Log.d("ROWCOUNT", " result : " + searchString);
session = new SessionManager(getActivity().getApplicationContext());
HashMap<String, String> user = session.getUserDetails();
String type = user.get(SessionManager.PAGE_TYPE);
try {
json_string = searchHandler.execute(String.valueOf(rowCount), searchString).get();
Log.d("STATE", "query result : " + json_string);
threadListAdapter.setLoaded(false);
inflateThreads();
} catch (InterruptedException e) {
e.printStackTrace();
} catch (ExecutionException e) {
e.printStackTrace();
}
}
use of ingage.ingage20.managers.SessionManager in project iNGAGE by davis123123.
the class SearchResultFragment method create.
public View create(final LayoutInflater inflater, final ViewGroup container, final Bundle savedInstanceState) {
// Inflate the layout for this fragment
session = new SessionManager(getContext());
HashMap<String, String> user = session.getUserDetails();
searchString = user.get(SessionManager.SEARCH_STRING);
Log.d("STATE", "searchstring " + searchString);
threadListAdapter = new ThreadListAdapter(this, getActivity());
getThreadsJSON(rowCount, searchString);
rootView = inflater.inflate(R.layout.fragment_front_page, container, false);
rootView.setTag(TAG);
return rootView;
}
use of ingage.ingage20.managers.SessionManager in project iNGAGE by davis123123.
the class UserInfoFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
// Inflate the layout for this fragment
rootView = inflater.inflate(R.layout.fragment_user_info, container, false);
recycler = (RecyclerView) rootView.findViewById(R.id.info);
mLoadingView = rootView.findViewById(R.id.loading_spinner);
SessionManager session = new SessionManager(getContext());
HashMap<String, String> info = session.getUserDetails();
if (userProfileActivity.getUsername().equals(info.get(SessionManager.KEY_NAME))) {
mLoadingView.setVisibility(View.GONE);
final LinearLayoutManager layoutManager = new LinearLayoutManager(getContext());
recycler.setLayoutManager(layoutManager);
adapter = new UserProfileInfoAdapter();
recycler.setAdapter(adapter);
username = info.get(SessionManager.KEY_NAME);
email = info.get(SessionManager.KEY_EMAIL);
tribute_pts = info.get(SessionManager.KEY_TRIBUTE_POINTS);
subs = info.get(SessionManager.KEY_SUBSCRIPTIONS);
date_joined = info.get(SessionManager.KEY_DATE_JOINED);
if (email != null && email.length() > 0)
adapter.add("Email: " + email);
else
adapter.add("Email: N/A");
adapter.add("Tribute points: " + tribute_pts);
setSubscriptions();
adapter.add("Date joined: " + date_joined);
adapter.notifyDataSetChanged();
} else {
UserInfoHandler.CallBackData callBackData = new UserInfoHandler.CallBackData() {
@Override
public void notifyChange(String serverResponse) {
Log.d("SERVERREeeSPONSE", serverResponse);
parseProfileJSON(serverResponse);
crossFadeRecyler();
}
};
handler = new UserInfoHandler();
handler.setCallBackData(callBackData);
handler.enqueue(userProfileActivity.getUsername());
recycler.setVisibility(View.GONE);
mShortAnimationDuration = getResources().getInteger(android.R.integer.config_shortAnimTime);
}
return rootView;
}
use of ingage.ingage20.managers.SessionManager in project iNGAGE by davis123123.
the class ChangeAvatarActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_change_avatar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setTitle("Profile Photo");
change = (Button) findViewById(R.id.change_avatar);
new_avatar_preview = (CircularImageView) findViewById(R.id.prof_img_preview);
SessionManager session = new SessionManager(getApplicationContext());
HashMap<String, String> info = session.getUserDetails();
username = info.get(SessionManager.KEY_NAME);
downloadCurrentAvatar();
setListeners();
}
use of ingage.ingage20.managers.SessionManager in project iNGAGE by davis123123.
the class ChatActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_chat);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
session = new SessionManager(getApplicationContext());
HashMap<String, String> user = session.getUserDetails();
username = user.get(SessionManager.KEY_NAME);
chatRoomManager = new ChatRoomManager(getApplicationContext());
timerTv = (TextView) findViewById(R.id.timertv);
useCoinBt = (Button) findViewById(R.id.cooldownButton);
textArea = (LinearLayout) findViewById(R.id.text_area);
textButtons = (LinearLayout) findViewById(R.id.text_right);
timerTv.setVisibility(View.GONE);
useCoinBt.setVisibility(View.GONE);
Bundle extras = getIntent().getExtras();
if (extras != null) {
String title = extras.getString("title");
Log.i("clicked title: ", title);
ActionBar mActionBarToolbar = getSupportActionBar();
mActionBarToolbar.setTitle(title);
}
useCoinBt.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Log.d("Click", "clicked");
useCoin();
}
});
// click to use token
// getuser details
HashMap<String, String> chat = chatRoomManager.getUserDetails();
thread_id = chat.get(ChatRoomManager.THREAD_ID);
user_side = chat.get(ChatRoomManager.SIDE);
if (user_side != null) {
// fifteen minutes of inactivity will kick user out
kickTimer(900000);
Log.d("STATE", "side: " + user_side);
}
// Does not kick out spectator with timer
// ENTER MESSAGES WITH @TAGS
textField = (EditText) findViewById(R.id.msgField);
textChangeListener();
setKeyBoardListener();
// thread id for root of comments tree
root = FirebaseDatabase.getInstance().getReference().child(thread_id);
// TAKES TIME TO TRANSACT
pageCount(root);
// add messages to recycler view by clicking send
addButton = (Button) findViewById(R.id.sendMessageButton);
if (addButton != null) {
addButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
sendMsg();
}
});
// click to send message
// calls event listener to update message in realtime
// eventListener(root);
}
HashMap<String, String> chat_user = chatRoomManager.getUserDetails();
String spectator = chat_user.get(ChatRoomManager.SPECTATOR);
if (spectator.equals("true")) {
setSpectateMode();
}
}
Aggregations