private void initView()
        {
            LayoutInflater inflater = (LayoutInflater)Context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);

            inflater.inflate(R.layout.fc_control_bar, this, true);
            mRoot         = (LinearLayout)findViewById(R.id.control_bar_root_layout);
            mRecyclerView = (RecyclerView)findViewById(R.id.devices_layout);

            FcItemAnimator itemAnimator = new FcItemAnimator(mRecyclerView);

            itemAnimator.AddDuration    = FcConstants.DEFAULT_ANIM_DURATION;
            itemAnimator.ChangeDuration = FcConstants.DEFAULT_ANIM_DURATION;
            itemAnimator.MoveDuration   = FcConstants.DEFAULT_ANIM_DURATION;
            itemAnimator.RemoveDuration = FcConstants.DEFAULT_ANIM_DURATION;

            mRecyclerView.ItemAnimator = itemAnimator;
            mModel   = new FcModel(mFcContext);
            mAdapter = new FcAdapter(mFcContext, mModel);

            //
            // Temporary workaround for a bug in RecyclerView:
            //      https://code.google.com/p/android/issues/detail?id=74772
            //
            // This custom LinearLayoutManager is on Apache 2.0 licence
            //
            // Fix this when it's fixed ("targeted early 2016")
            //
            LinearLayoutManager layoutManager = new LinearLayoutManager(Context);

            layoutManager.Orientation   = LinearLayoutManager.HORIZONTAL;
            mRecyclerView.LayoutManager = layoutManager;
            mRecyclerView.Adapter       = mAdapter;

            mBarHandler = (ImageButton)findViewById(R.id.barhandler);
            mBarHandler.BackgroundResource = R.drawable.arrow_open;
            mBarHandler.OnClickListener    = new OnClickListenerAnonymousInnerClassHelper(this);

            mMainAppImage = (ImageButton)findViewById(R.id.main_app_image);
            mMainAppImage.OnLongClickListener = new FcControlBarLongClickListener(this);
            mFcAnimator = new FcAnimator();
        }
Exemplo n.º 2
0
		private void initView()
		{
			LayoutInflater inflater = (LayoutInflater) Context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
			inflater.inflate(R.layout.fc_control_bar, this, true);
			mRoot = (LinearLayout) findViewById(R.id.control_bar_root_layout);
			mRecyclerView = (RecyclerView)findViewById(R.id.devices_layout);

			FcItemAnimator itemAnimator = new FcItemAnimator(mRecyclerView);
			itemAnimator.AddDuration = FcConstants.DEFAULT_ANIM_DURATION;
			itemAnimator.ChangeDuration = FcConstants.DEFAULT_ANIM_DURATION;
			itemAnimator.MoveDuration = FcConstants.DEFAULT_ANIM_DURATION;
			itemAnimator.RemoveDuration = FcConstants.DEFAULT_ANIM_DURATION;

			mRecyclerView.ItemAnimator = itemAnimator;
			mModel = new FcModel(mFcContext);
			mAdapter = new FcAdapter(mFcContext, mModel);

			//
			// Temporary workaround for a bug in RecyclerView:
			//      https://code.google.com/p/android/issues/detail?id=74772
			//
			// This custom LinearLayoutManager is on Apache 2.0 licence
			//
			// Fix this when it's fixed ("targeted early 2016")
			//
			LinearLayoutManager layoutManager = new LinearLayoutManager(Context);
			layoutManager.Orientation = LinearLayoutManager.HORIZONTAL;
			mRecyclerView.LayoutManager = layoutManager;
			mRecyclerView.Adapter = mAdapter;

			mBarHandler = (ImageButton)findViewById(R.id.barhandler);
			mBarHandler.BackgroundResource = R.drawable.arrow_open;
			mBarHandler.OnClickListener = new OnClickListenerAnonymousInnerClassHelper(this);

			mMainAppImage = (ImageButton)findViewById(R.id.main_app_image);
			mMainAppImage.OnLongClickListener = new FcControlBarLongClickListener(this);
			mFcAnimator = new FcAnimator();
		}