Search in sources :

Example 21 with SessionManager

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);
}
Also used : SessionManager(ingage.ingage.managers.SessionManager)

Example 22 with SessionManager

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);
}
Also used : SessionManager(ingage.ingage.managers.SessionManager) ChatRoomManager(ingage.ingage.managers.ChatRoomManager) SpectateRoomHandler(ingage.ingage.handlers.SpectateRoomHandler) ChatRoomHandler(ingage.ingage.handlers.ChatRoomHandler) Handler(android.os.Handler) SwipeRefreshLayout(android.support.v4.widget.SwipeRefreshLayout)

Example 23 with SessionManager

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();
    }
}
Also used : SearchHandler(ingage.ingage.handlers.SearchHandler) SessionManager(ingage.ingage.managers.SessionManager) ExecutionException(java.util.concurrent.ExecutionException)

Example 24 with SessionManager

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);
 *        }*
 */
}
Also used : SessionManager(ingage.ingage.managers.SessionManager) ImageView(android.widget.ImageView)

Aggregations

SessionManager (ingage.ingage.managers.SessionManager)24 View (android.view.View)7 ExecutionException (java.util.concurrent.ExecutionException)6 TextView (android.widget.TextView)5 ImageView (android.widget.ImageView)4 ChatRoomManager (ingage.ingage.managers.ChatRoomManager)4 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)3 RecyclerView (android.support.v7.widget.RecyclerView)3 Bundle (android.os.Bundle)2 ActionBar (android.support.v7.app.ActionBar)2 ThreadListAdapter (ingage.ingage.adapters.ThreadListAdapter)2 ChatRoomHandler (ingage.ingage.handlers.ChatRoomHandler)2 QueryThreadsHandler (ingage.ingage.handlers.QueryThreadsHandler)2 SpectateRoomHandler (ingage.ingage.handlers.SpectateRoomHandler)2 HashMap (java.util.HashMap)2 FragmentManager (android.app.FragmentManager)1 Context (android.content.Context)1 Intent (android.content.Intent)1 Resources (android.content.res.Resources)1 BitmapDrawable (android.graphics.drawable.BitmapDrawable)1