use of ingage.ingage.managers.SessionManager in project iNGAGE by davis123123.
the class SearchResultActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mContext = getApplicationContext();
session = new SessionManager(mContext);
HashMap<String, String> user = session.getUserDetails();
String searchString = user.get(SessionManager.SEARCH_STRING);
setTitle(searchString);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
setContentView(R.layout.activity_search);
Log.d("SEARCHRESULTACT", "here");
viewPager = (ViewPager) findViewById(R.id.viewpager);
tabLayout = (TabLayout) findViewById(R.id.tabs);
tabLayout.setupWithViewPager(viewPager);
setupViewPager(viewPager);
}
use of ingage.ingage.managers.SessionManager in project iNGAGE by davis123123.
the class FragmentBase method onViewCreated.
@Override
public void onViewCreated(final View view, final Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
session = new SessionManager(getActivity().getApplicationContext());
user = session.getUserDetails();
chatRoomManager = new ChatRoomManager(getActivity().getApplicationContext());
swipeContainer = (SwipeRefreshLayout) view.findViewById(R.id.swipe_container);
msg = (TextView) view.findViewById(R.id.tvMsg);
icon = (ImageView) view.findViewById(R.id.ivIcon);
int color = getContext().getResources().getColor(R.color.gray);
icon.setColorFilter(color, PorterDuff.Mode.SRC_ATOP);
// Setup refresh listener which triggers new data loading
swipeContainer.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
EventBus.getDefault().post(new RefreshEvent());
swipeContainer.setRefreshing(false);
}
}, 700);
}
});
// Configure the refreshing colors
swipeContainer.setColorSchemeResources(android.R.color.holo_red_light, android.R.color.darker_gray);
}
use of ingage.ingage.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 = "active";
try {
json_string = searchHandler.execute(type, String.valueOf(rowCount), searchString).get();
Log.d("STATE", "query result : " + json_string);
if (json_string.equals("No results"))
Toast.makeText(getActivity(), "No search results", Toast.LENGTH_LONG).show();
else {
threadListAdapter.setLoaded(false);
inflateThreads();
}
} catch (InterruptedException e) {
e.printStackTrace();
} catch (ExecutionException e) {
e.printStackTrace();
}
}
use of ingage.ingage.managers.SessionManager in project iNGAGE by davis123123.
the class NavigationDrawer method updateUserImage.
private void updateUserImage(final AppCompatActivity activity) {
final SessionManager sessionManager = new SessionManager(mContext);
final ImageView imageView = (ImageView) activity.findViewById(R.id.userImage);
if (!sessionManager.isLoggedIn()) {
// Not signed in
if (Build.VERSION.SDK_INT < 22) {
imageView.setImageBitmap(BitmapFactory.decodeResource(activity.getResources(), R.mipmap.user));
} else {
imageView.setImageDrawable(activity.getDrawable(R.mipmap.user));
}
return;
}
/**
*final Bitmap userImage = identityManager.getUserImage();
* if (userImage != null) {
* imageView.setImageBitmap(userImage);
* }*
*/
}
Aggregations