Search in sources :

Example 6 with SlidingMenu

use of com.jeremyfeinstein.slidingmenu.lib.SlidingMenu in project ChatExchange by HueToYou.

the class ChatFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    // Inflate the layout for this fragment
    view = inflater.inflate(R.layout.fragment_chat, container, false);
    mSharedPreferences = PreferenceManager.getDefaultSharedPreferences(getActivity());
    hueUtils = new HueUtils();
    // configure the SlidingMenu
    mSlidingMenu = new SlidingMenu(getActivity());
    mSlidingMenu.setMode(SlidingMenu.RIGHT);
    mSlidingMenu.setTouchModeAbove(SlidingMenu.TOUCHMODE_MARGIN);
    mSlidingMenu.setShadowWidthRes(R.dimen.shadow_width);
    mSlidingMenu.setShadowDrawable(new ColorDrawable(getResources().getColor(R.color.transparentGrey)));
    //        mSlidingMenu.setBehindOffsetRes(R.dimen.slidingmenu_offset);
    //        mSlidingMenu.setBehindOffset((int)(dpWidth + getResources().getDimension(R.dimen.user_tile_width)));
    //        mSlidingMenu.setLayoutParams(new ActionBar.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
    mSlidingMenu.setBehindWidthRes(R.dimen.sliding_menu_width);
    mSlidingMenu.setFadeDegree(0.35f);
    mSlidingMenu.attachToActivity(getActivity(), SlidingMenu.SLIDING_CONTENT);
    mSlidingMenu.setMenu(R.layout.users_slideout);
    Bundle args = getArguments();
    String chatUrl = args.getString("chatUrl", "ERROR");
    mAppBarColor = args.getInt("AppBarColor", -1);
    addChatButtons(chatUrl);
    ParseUsers asyncTask = new ParseUsers();
    CancelTask canceller = new CancelTask(asyncTask);
    Handler handler = new Handler();
    handler.postDelayed(canceller, 10000);
    asyncTask.execute(chatUrl);
    getActivity().setTitle(args.getString("chatTitle", "Error"));
    //call addUser() here somehow....
    return view;
}
Also used : SlidingMenu(com.jeremyfeinstein.slidingmenu.lib.SlidingMenu) HueUtils(com.huetoyou.chatexchange.ui.misc.HueUtils) ColorDrawable(android.graphics.drawable.ColorDrawable) Bundle(android.os.Bundle) Handler(android.os.Handler)

Aggregations

SlidingMenu (com.jeremyfeinstein.slidingmenu.lib.SlidingMenu)6 ColorDrawable (android.graphics.drawable.ColorDrawable)1 Bundle (android.os.Bundle)1 Handler (android.os.Handler)1 FragmentTransaction (android.support.v4.app.FragmentTransaction)1 View (android.view.View)1 CheckBox (android.widget.CheckBox)1 CompoundButton (android.widget.CompoundButton)1 RadioGroup (android.widget.RadioGroup)1 OnCheckedChangeListener (android.widget.RadioGroup.OnCheckedChangeListener)1 SeekBar (android.widget.SeekBar)1 OnSeekBarChangeListener (android.widget.SeekBar.OnSeekBarChangeListener)1 HueUtils (com.huetoyou.chatexchange.ui.misc.HueUtils)1 SampleListFragment (com.jeremyfeinstein.slidingmenu.example.SampleListFragment)1