use of ingage.ingage.managers.SessionManager in project iNGAGE by davis123123.
the class ChatArrayAdapter method onCreateViewHolder.
@Override
public ChatViewHolder onCreateViewHolder(ViewGroup viewGroup, int viewType) {
// Get the RecyclerView item layout
Context context = viewGroup.getContext();
LayoutInflater inflater = LayoutInflater.from(context);
boolean shouldAttachToParentImmediately = false;
View view = inflater.inflate(R.layout.item_chat_post_agree, viewGroup, false);
Log.d("STATE", "viewType: " + viewType);
unselectedColor = context.getResources().getColor(R.color.tab_text_unselected);
selectedColorAgree = context.getResources().getColor(R.color.green);
selectedColorDisagree = context.getResources().getColor(R.color.colorPrimary);
SessionManager session = new SessionManager(viewGroup.getContext());
HashMap<String, String> user = session.getUserDetails();
username = user.get(SessionManager.KEY_NAME);
if (viewType == 0)
view = inflater.inflate(R.layout.item_chat_post_agree_you, viewGroup, false);
else if (viewType == 1)
view = inflater.inflate(R.layout.item_chat_post_agree, viewGroup, false);
if (viewType == 2)
view = inflater.inflate(R.layout.item_chat_post_disagree_you, viewGroup, false);
else if (viewType == 3)
view = inflater.inflate(R.layout.item_chat_post_disagree, viewGroup, false);
return new ChatViewHolder(view);
}
use of ingage.ingage.managers.SessionManager in project iNGAGE by davis123123.
the class ArchivedFragment method getThreadsJSON.
public void getThreadsJSON(int rowCount) {
queryThreadsHandler = new QueryThreadsHandler();
SessionManager session = new SessionManager(getActivity().getApplicationContext());
HashMap<String, String> user = session.getUserDetails();
String test = user.get(SessionManager.CATEGORY_TYPE);
Log.d("ARCCATE", " " + test + " " + rowCount);
try {
if (user.get(SessionManager.CATEGORY_TYPE) != null) {
json_string = queryThreadsHandler.execute("categoryArchived", user.get(SessionManager.CATEGORY_TYPE), String.valueOf(rowCount)).get();
Log.d("ARCCATE2", " " + json_string);
} else {
json_string = queryThreadsHandler.execute("archived", String.valueOf(rowCount)).get();
}
Log.d("STATE", "query result : " + json_string);
threadListAdapter.setLoaded(false);
} catch (InterruptedException e) {
e.printStackTrace();
} catch (ExecutionException e) {
e.printStackTrace();
}
}
use of ingage.ingage.managers.SessionManager in project iNGAGE by davis123123.
the class ChatFragment method insertVote.
@Override
public void insertVote(int p, String prev_voted, String vote) {
String type = "insert_vote";
ChatFeaturesHandler chatFeaturesHandler = new ChatFeaturesHandler(getContext());
ChatMessageHelper chatMessageHelper = (ChatMessageHelper) chatAdapter.getItem(p);
// sets user's vote to memory
chatMessageHelper.setUserVote(vote);
// username is messageBy
String messageBy = chatMessageHelper.getMessageUser();
Log.d("insertvote", type + vote + prev_voted);
String chat_id = chatMessageHelper.getMessageID();
String chat_side = chatMessageHelper.getSide();
HashMap<String, String> chat = chatRoomManager.getUserDetails();
String thread_id = chat.get(ChatRoomManager.THREAD_ID);
session = new SessionManager(getContext());
HashMap<String, String> user = session.getUserDetails();
// chatuser is current user of app
String chat_user = user.get(SessionManager.KEY_NAME);
// insert vote into target user profile and own profile
Log.d("insertvote", chat_user);
String result = "";
try {
result = chatFeaturesHandler.execute(type, messageBy, thread_id, prev_voted, chat_id, vote, chat_side, chat_user).get();
} catch (InterruptedException | ExecutionException e) {
e.printStackTrace();
}
// Log.d("insertvote", result);
}
use of ingage.ingage.managers.SessionManager in project iNGAGE by davis123123.
the class SearchResultArchivedFragment 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);
rowCount = 0;
threadListAdapter = new ThreadListAdapter(this, getActivity(), false);
getThreadsJSON(rowCount, searchString);
rootView = inflater.inflate(R.layout.fragment_archived, container, false);
rootView.setTag(TAG);
return rootView;
}
use of ingage.ingage.managers.SessionManager in project iNGAGE by davis123123.
the class ChangeAvatarActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
loadingDialog("Loading");
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();
}
Aggregations