Java Code Examples for android.widget.RelativeLayout#setVisibility()

The following examples show how to use android.widget.RelativeLayout#setVisibility() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CategoryFragment.java    From wallpaper with GNU General Public License v2.0 6 votes vote down vote up
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
		Bundle savedInstanceState) {
	View view = inflater.inflate(R.layout.fragment_category, container,
				false);
	
	ViewGroup parent = (ViewGroup) view.getParent();
	if (parent != null) {
		parent.removeView(view);
	}
	categorylistview = (ListView) view.findViewById(R.id.category_listview);
	categoryNetWorkRelativeLayout = (RelativeLayout) view.findViewById(R.id.category_netWork_relativeLayout);
	categorylistview.setOnItemClickListener(this);
	if(this.mShowNoNetworkView){
		categoryNetWorkRelativeLayout.setVisibility(View.VISIBLE);
		categorylistview.setVisibility(View.GONE);
	}else{
		categoryNetWorkRelativeLayout.setVisibility(View.GONE);
		categorylistview.setVisibility(View.VISIBLE);
	}
	return view;
}
 
Example 2
Source File: QuickScroll.java    From PkRequestManager with MIT License 6 votes vote down vote up
private RelativeLayout createPin()
{
	final RelativeLayout pinLayout = new RelativeLayout(getContext());
	pinLayout.setVisibility(View.INVISIBLE);
	
	final Pin pin = new Pin(getContext());
	pin.setId(ID_PIN);
	final RelativeLayout.LayoutParams pinParams = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
	pinParams.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
	pinParams.addRule(RelativeLayout.ALIGN_BOTTOM, ID_PIN_TEXT);
	pinParams.addRule(RelativeLayout.ALIGN_TOP, ID_PIN_TEXT);
	pin.setLayoutParams(pinParams);
	pinLayout.addView(pin);
	
	final TextView indicatorTextView = new TextView(getContext());
	indicatorTextView.setId(ID_PIN_TEXT);
	final RelativeLayout.LayoutParams indicatorParams = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
	indicatorParams.addRule(RelativeLayout.LEFT_OF, ID_PIN);
	indicatorTextView.setLayoutParams(indicatorParams);
	indicatorTextView.setTextColor(Color.WHITE);
	indicatorTextView.setGravity(Gravity.CENTER);
	indicatorTextView.setBackgroundColor(GREY_LIGHT);
	pinLayout.addView(indicatorTextView);
	
	return pinLayout;
}
 
Example 3
Source File: PickerAlbumActivity.java    From NIM_Android_UIKit with MIT License 6 votes vote down vote up
private void initUI() {
    // bottom bar
    pickerBottomBar = (RelativeLayout) findViewById(R.id.picker_bottombar);
    if (isMutiMode) {
        pickerBottomBar.setVisibility(View.VISIBLE);
    } else {
        pickerBottomBar.setVisibility(View.GONE);
    }
    pickerPreview = (TextView) findViewById(R.id.picker_bottombar_preview);
    pickerPreview.setOnClickListener(this);
    pickerSend = (TextView) findViewById(R.id.picker_bottombar_select);
    pickerSend.setOnClickListener(this);

    // fragment
    pickerAlbumLayout = (FrameLayout) findViewById(R.id.picker_album_fragment);
    pickerPhotosLayout = (FrameLayout) findViewById(R.id.picker_photos_fragment);
    photoFolderFragment = new PickerAlbumFragment();
    switchContent(photoFolderFragment);

    isAlbumPage = true;
}
 
Example 4
Source File: GalleryFragment.java    From CameraV with GNU General Public License v3.0 6 votes vote down vote up
@Override
public View onCreateView(LayoutInflater li, ViewGroup container,
		Bundle savedInstanceState) {
	super.onCreateView(li, container, savedInstanceState);

	rootView = li.inflate(R.layout.fragment_gallery, null);
	mediaDisplayGrid = (GridView) rootView
			.findViewById(R.id.media_display_grid);
	noMedia = (RelativeLayout) rootView
			.findViewById(R.id.media_display_no_media);
	noMedia.setVisibility(View.GONE);
	
	progressWait = (ProgressBar) rootView.findViewById(R.id.progressWait);
	progressWait.setVisibility(View.GONE);
	
	mEncodingMedia = rootView.findViewById(R.id.media_encoding);
	mEncodingMedia.setVisibility(View.GONE);
	mEncodingMedia.findViewById(R.id.ivClose).setOnClickListener(new View.OnClickListener() {
		
		@Override
		public void onClick(View v) {
			mEncodingMedia.setVisibility(View.GONE);
		}
	});
	return rootView;
}
 
Example 5
Source File: BestMatchesAdapter.java    From Rey-MusicPlayer with Apache License 2.0 6 votes vote down vote up
public ItemHolder(View itemView) {
    super(itemView);

    albumName = (TextView) itemView.findViewById(R.id.gridViewTitleText);
    artistName = (TextView) itemView.findViewById(R.id.gridViewSubText);
    albumart = (ImageView) itemView.findViewById(R.id.gridViewImage);
    itemView.findViewById(R.id.overflow).setVisibility(View.INVISIBLE);

    albumName.setTypeface(TypefaceHelper.getTypeface(itemView.getContext().getApplicationContext(), TypefaceHelper.FUTURA_BOOK));
    artistName.setTypeface(TypefaceHelper.getTypeface(itemView.getContext().getApplicationContext(), TypefaceHelper.FUTURA_BOOK));
    mFooter = (RelativeLayout) itemView.findViewById(R.id.linear_layout_footer);
    mFooter.setVisibility(View.GONE);

    itemView.setOnClickListener(v -> mId3TagEditorActivity.updateAlbumArt(
            mBestMatchesModels.get(getAdapterPosition()).artworkUrl100.replace("100x100", "500x500")
            /*,mBestMatchesModels.get(getAdapterPosition()).trackName,
            mBestMatchesModels.get(getAdapterPosition()).collectionName,
            mBestMatchesModels.get(getAdapterPosition()).artistName,
            mBestMatchesModels.get(getAdapterPosition()).primaryGenreName,
            mBestMatchesModels.get(getAdapterPosition()).releaseDate,
            mBestMatchesModels.get(getAdapterPosition()).trackNumber,
            mBestMatchesModels.get(getAdapterPosition()).trackCount*/
    ));
}
 
Example 6
Source File: MyFansAdapter.java    From tysq-android with GNU General Public License v3.0 6 votes vote down vote up
/**
 * 改变关注状态
 *
 * @param isAttention 是否关注
 * @param button      关注按钮
 * @param add         +图片
 * @param layout      父布局
 */
private void changeBtnAttention(boolean isAttention, TextView button, ImageView add, RelativeLayout layout) {
    if (!isAttention) {
        layout.setVisibility(View.VISIBLE);
        layout.setBackground(ContextCompat.getDrawable(getContext(), R.drawable.shape_blue_rect));
        button.setText(R.string.personal_focus_someone);
        add.setVisibility(View.VISIBLE);
        button.setTextColor(ContextCompat.getColor(getContext(), R.color.white));
    } else {
        layout.setVisibility(View.VISIBLE);
        layout.setBackground(ContextCompat.getDrawable(getContext(), R.drawable.shape_dark_gray_fill_4dp));
        button.setText(R.string.personal_focused);
        button.setTextColor(ContextCompat.getColor(getContext(), R.color.white));
        RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) button.getLayoutParams();
        layoutParams.addRule(RelativeLayout.CENTER_IN_PARENT);
        add.setVisibility(View.GONE);
    }
}
 
Example 7
Source File: MyAttentionAdapter.java    From tysq-android with GNU General Public License v3.0 6 votes vote down vote up
/**
 * 改变关注状态
 *
 * @param isAttention 是否关注
 * @param button      关注按钮
 * @param add         +图片
 * @param layout      父布局
 */
private void changeBtnAttention(boolean isAttention, TextView button, ImageView add, RelativeLayout layout) {
    if (!isAttention) {
        layout.setVisibility(View.VISIBLE);
        layout.setBackground(ContextCompat.getDrawable(getContext(), R.drawable.shape_blue_rect));
        button.setText(R.string.personal_focus_someone);
        add.setVisibility(View.VISIBLE);
        button.setTextColor(ContextCompat.getColor(getContext(), R.color.white));
    } else {
        layout.setVisibility(View.VISIBLE);
        layout.setBackground(ContextCompat.getDrawable(getContext(), R.drawable.shape_dark_gray_fill_4dp));
        button.setText(R.string.personal_focused);
        button.setTextColor(ContextCompat.getColor(getContext(), R.color.white));
        RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) button.getLayoutParams();
        layoutParams.addRule(RelativeLayout.CENTER_IN_PARENT);
        add.setVisibility(View.GONE);
    }
}
 
Example 8
Source File: SubRecommendedFragment.java    From wallpaper with GNU General Public License v2.0 5 votes vote down vote up
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
	View view = inflater.inflate(R.layout.fragment_sub_recommended, container, false);
	mPullToRefreshView = (PullToRefreshView) view.findViewById(R.id.fragment_pull_sub_recommended_view);
	SubCategoryActivity activity = (SubCategoryActivity) this.getActivity();
	mPullToRefreshView.setOnHeaderRefreshListener(activity);
	mPullToRefreshView.setOnFooterRefreshListener(activity);
	ViewGroup parent = (ViewGroup) view.getParent();
	if (parent != null) {
		parent.removeView(view);
	}
	sub_recommendedNetWorkRelativeLayout = (RelativeLayout) view.findViewById(R.id.sub_recommended_netWork_relativeLayout);

	mPhotoWall = (GridView) view.findViewById(R.id.fragment_sub_recommended_gridview);
	mPhotoWall.setSelector(new ColorDrawable(Color.TRANSPARENT));

	float width = (float) (WallWrapperEnvConfigure.getScreenWidth() / 3.0);
	mPhotoWall.setColumnWidth((int) width);

	mPhotoWall.setOnItemClickListener(this);

	if (this.mShowNoNetworkView) {
		sub_recommendedNetWorkRelativeLayout.setVisibility(View.VISIBLE);
		mPullToRefreshView.setVisibility(View.GONE);
	} else {
		sub_recommendedNetWorkRelativeLayout.setVisibility(View.GONE);
		mPullToRefreshView.setVisibility(View.VISIBLE);
	}
	return view;
}
 
Example 9
Source File: EaseEmojiconIndicatorView.java    From Social with Apache License 2.0 5 votes vote down vote up
public void updateIndicator(int count) {
    if(dotViews == null){
        return;
    }
    for(int i = 0 ; i < dotViews.size() ; i++){
        if(i >= count){
            dotViews.get(i).setVisibility(GONE);
            ((View)dotViews.get(i).getParent()).setVisibility(GONE);
        }
        else {
            dotViews.get(i).setVisibility(VISIBLE);
            ((View)dotViews.get(i).getParent()).setVisibility(VISIBLE);
        }
    }
    if(count > dotViews.size()){
        int diff = count - dotViews.size();
        for(int i = 0 ; i < diff ; i++){
            RelativeLayout rl = new RelativeLayout(context);
            LayoutParams params = new LinearLayout.LayoutParams(dotHeight,dotHeight);
            RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT,RelativeLayout.LayoutParams.WRAP_CONTENT);
            layoutParams.addRule(RelativeLayout.CENTER_IN_PARENT);
            ImageView imageView = new ImageView(context);
            imageView.setImageBitmap(unselectedBitmap);
            rl.addView(imageView, layoutParams);
            rl.setVisibility(View.GONE);
            imageView.setVisibility(View.GONE);
            this.addView(rl, params);
            dotViews.add(imageView);
        }
    }
}
 
Example 10
Source File: RecommendedFragment.java    From wallpaper with GNU General Public License v2.0 5 votes vote down vote up
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
	View view = inflater.inflate(R.layout.fragment_recommended, container, false);

	mPullToRefreshView = (PullToRefreshView) view.findViewById(R.id.fragment_pull_recommended_view);
	MainActivity activity = (MainActivity) this.getActivity();
	mPullToRefreshView.setOnHeaderRefreshListener(activity);
	mPullToRefreshView.setOnFooterRefreshListener(activity);

	mPhotoWall = (GridView) view.findViewById(R.id.fragment_recommended_gridview);
	mPhotoWall.setSelector(new ColorDrawable(Color.TRANSPARENT));

	recommendedNetWorkRelativeLayout = (RelativeLayout) view.findViewById(R.id.recommended_netWork_relativeLayout);

	float width = (float) (WallWrapperEnvConfigure.getScreenWidth() / 3.0);
	mPhotoWall.setColumnWidth((int) width);

	mPhotoWall.setOnItemClickListener(this);

	if (this.mShowNoNetworkView) {
		recommendedNetWorkRelativeLayout.setVisibility(View.VISIBLE);
		mPullToRefreshView.setVisibility(View.GONE);
	} else {
		recommendedNetWorkRelativeLayout.setVisibility(View.GONE);
		mPullToRefreshView.setVisibility(View.VISIBLE);
	}

	return view;
}
 
Example 11
Source File: EaseEmojiconIndicatorView.java    From Study_Android_Demo with Apache License 2.0 5 votes vote down vote up
public void updateIndicator(int count) {
    if(dotViews == null){
        return;
    }
    for(int i = 0 ; i < dotViews.size() ; i++){
        if(i >= count){
            dotViews.get(i).setVisibility(GONE);
            ((View)dotViews.get(i).getParent()).setVisibility(GONE);
        }
        else {
            dotViews.get(i).setVisibility(VISIBLE);
            ((View)dotViews.get(i).getParent()).setVisibility(VISIBLE);
        }
    }
    if(count > dotViews.size()){
        int diff = count - dotViews.size();
        for(int i = 0 ; i < diff ; i++){
            RelativeLayout rl = new RelativeLayout(context);
            LayoutParams params = new LinearLayout.LayoutParams(dotHeight,dotHeight);
            RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT,RelativeLayout.LayoutParams.WRAP_CONTENT);
            layoutParams.addRule(RelativeLayout.CENTER_IN_PARENT);
            ImageView imageView = new ImageView(context);
            imageView.setImageBitmap(unselectedBitmap);
            rl.addView(imageView, layoutParams);
            rl.setVisibility(View.GONE);
            imageView.setVisibility(View.GONE);
            this.addView(rl, params);
            dotViews.add(imageView);
        }
    }
}
 
Example 12
Source File: SubFloorFactory.java    From JianDan with Apache License 2.0 5 votes vote down vote up
public View buildSubHideFloor ( Commentable cmt, ViewGroup group ) {
    LayoutInflater inflater = ( LayoutInflater ) group.getContext ().getSystemService ( Context.LAYOUT_INFLATER_SERVICE ) ;
    View view = inflater.inflate ( R.layout.item_comment_floor, null ) ;
    RelativeLayout show = ( RelativeLayout ) view.findViewById ( R.id.show_sub_floor_content ) ;
    RelativeLayout hide = ( RelativeLayout ) view.findViewById ( R.id.hide_sub_floor_content ) ;
    show.setVisibility ( View.GONE ) ;
    hide.setVisibility ( View.VISIBLE ) ;
    TextView hide_text = ( TextView ) view.findViewById ( R.id.hide_text ) ;
    hide_text.setCompoundDrawablesWithIntrinsicBounds ( R.drawable.ic_comment_down_arrow, 0, 0, 0 ) ;
    view.findViewById ( R.id.hide_pb ).setVisibility ( View.GONE ) ;
    return view ;
}
 
Example 13
Source File: EmptyView.java    From android-project-wo2b with Apache License 2.0 5 votes vote down vote up
private void setUp(Context context)
{
	mRootView = (RelativeLayout) LayoutInflater.from(context).inflate(R.layout.wrapper_empty_view, this);
	mEmptyView = (RelativeLayout) mRootView.findViewById(R.id.empty_container);
	mGifView = (ImageView) mRootView.findViewById(R.id.empty_gif);
	mGifShadowView = (ImageView) mRootView.findViewById(R.id.empty_gif_panel);
	mIndicatorView = (ImageView) mRootView.findViewById(R.id.empty_indicator);
	mMessageView = (TextView) mRootView.findViewById(R.id.message);
	
	mEmptyView.setVisibility(View.GONE);
}
 
Example 14
Source File: SubFloorFactory.java    From JianDan_OkHttp with Apache License 2.0 5 votes vote down vote up
public View buildSubHideFloor ( Commentable cmt, ViewGroup group ) {
    LayoutInflater inflater = ( LayoutInflater ) group.getContext ().getSystemService ( Context.LAYOUT_INFLATER_SERVICE ) ;
    View view = inflater.inflate ( R.layout.item_comment_floor, null ) ;
    RelativeLayout show = ( RelativeLayout ) view.findViewById ( R.id.show_sub_floor_content ) ;
    RelativeLayout hide = ( RelativeLayout ) view.findViewById ( R.id.hide_sub_floor_content ) ;
    show.setVisibility ( View.GONE ) ;
    hide.setVisibility ( View.VISIBLE ) ;
    TextView hide_text = ( TextView ) view.findViewById ( R.id.hide_text ) ;
    hide_text.setCompoundDrawablesWithIntrinsicBounds ( R.drawable.ic_comment_down_arrow, 0, 0, 0 ) ;
    view.findViewById ( R.id.hide_pb ).setVisibility ( View.GONE ) ;
    return view ;
}
 
Example 15
Source File: DeviceControlCardItemView.java    From arcusandroid with Apache License 2.0 5 votes vote down vote up
private void showCloudOfflineBanner(DeviceControlCard card) {
    View banner = findViewById(R.id.card_device_bottom_part);
    banner.setVisibility(View.VISIBLE);
    banner.setBackgroundColor(getResources().getColor(R.color.pink_banner));

    View waiting = findViewById(R.id.waiting_on_label_device_list);
    if(card.isIsEventInProcess()) {
        waiting.setVisibility(View.VISIBLE);
    }
    else {
        waiting.setVisibility(View.GONE);
    }

    if(card.getDeviceId() !=null) {
        final DeviceModel model = SessionModelManager.instance().getDeviceWithId(card.getDeviceId(), false);
        if (model != null) {
            ImageView icon = (ImageView) findViewById(R.id.product_icon);
            String vendorName = String.valueOf(model.getVendor()).toUpperCase();
            ImageManager.with(getContext())
                    .putBrandImage(vendorName)
                    .withTransform(new BlackWhiteInvertTransformation(Invert.BLACK_TO_WHITE))
                    .into(icon)
                    .execute();
        }
    }

    RelativeLayout offlineBanner = (RelativeLayout) findViewById(R.id.device_offline_banner);
    offlineBanner.setVisibility(INVISIBLE);

    setBackgroundColor(getContext().getResources().getColor(R.color.cardview_dark_background));
    hideControls();
}
 
Example 16
Source File: PipTestActivity.java    From dttv-android with GNU General Public License v3.0 5 votes vote down vote up
private void setupView() {
    mSurfaceView = (SurfaceView) findViewById(R.id.surfaceView);
    mSurfaceView.getHolder().addCallback(callback);

    mCtlPanel = (LinearLayout) findViewById(R.id.control_panel);
    mCtlPanel.setVisibility(View.VISIBLE);

    mCtlBar = (RelativeLayout) findViewById(R.id.control_bar);
    mCtlBar.setVisibility(View.VISIBLE);

    mPauseButton = (ImageButton) findViewById(R.id.btn_pause);
    mNextButton = (ImageButton) findViewById(R.id.btn_next);
    mInfoButton = (ImageButton) findViewById(R.id.btn_info);
    mRatioButton = (ImageButton) findViewById(R.id.btn_ratio);

    mSeekBarProgress = (SeekBar) findViewById(R.id.seekbar_time);
    mTextViewCurTime = (TextView) findViewById(R.id.txt_cur);
    mTextViewDuration = (TextView) findViewById(R.id.txt_dur);
    mTextViewInfo = (TextView) findViewById(R.id.txt_info);
    mImageViewSub = (ImageView) findViewById(R.id.iv_sub);
    mImageViewSub.setVisibility(View.VISIBLE);

    DisplayMetrics displayMetrics = new DisplayMetrics();
    getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
    mScreenWidth = displayMetrics.widthPixels;
    mScreenHeight = displayMetrics.heightPixels;
}
 
Example 17
Source File: EmptyViewProgressBar.java    From android-project-wo2b with Apache License 2.0 5 votes vote down vote up
private void setUp(Context context)
{
	mRootView = (RelativeLayout) LayoutInflater.from(context).inflate(R.layout.wrapper_empty_view, this);
	mEmptyView = (RelativeLayout) mRootView.findViewById(R.id.container);
	mProgressBar = (ProgressBar) mRootView.findViewById(R.id.progressBar);
	mBackground = (ImageView) mRootView.findViewById(R.id.background);
	mMessage = (TextView) mRootView.findViewById(R.id.message);

	mEmptyView.setVisibility(View.GONE);
}
 
Example 18
Source File: SuperSwipeRefreshLayout.java    From NIM_Android_UIKit with MIT License 4 votes vote down vote up
/**
 * 添加底部布局
 */
private void createFooterViewContainer() {
    mFooterViewContainer = new RelativeLayout(getContext());
    mFooterViewContainer.setVisibility(View.GONE);
    addView(mFooterViewContainer);
}
 
Example 19
Source File: CameraPreviewActivity.java    From Fatigue-Detection with MIT License 4 votes vote down vote up
private void init(){
        GlobalConfig.context=this;
        if(DEBUG)
            FilterResourceHelper.generateFilterThumbs(CameraPreviewActivity.this,false);
        FileUtils.upZipFile(this,"filter/thumbs/thumbs.zip",getFilesDir().getAbsolutePath());
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
        getSupportActionBar().hide();
        setContentView(R.layout.camera_preview);

        WindowManager.LayoutParams params = getWindow().getAttributes();
        params.flags |= WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON;
        getWindow().setAttributes(params);

        glRootView= (GLRootView) findViewById(R.id.camera_view);
        cameraView=new CameraView(this,glRootView);

        cameraView.setScreenSizeChangedListener(new CameraView.ScreenSizeChangedListener() {
            @Override
            public void updateScreenSize(int width, int height) {
                Log.d(TAG, "updateScreenSize: "+width+" "+height);
                surfaceWidth=width;
                surfaceHeight=height;
                captureAnimation.resetAnimationSize(width,height);
            }
        });

        captureAnimation= (CaptureAnimation) findViewById(R.id.capture_animation_view);

        findViewById(R.id.record_btn).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
//                WindowManager windowManager = (WindowManager) getSystemService(Context.WINDOW_SERVICE);
//                int rotation = windowManager.getDefaultDisplay().getRotation();
//                Log.d(TAG, "onClick: "+rotation);
                if(isRecording){
                    cameraView.getCameraEngine().releaseRecorder();
                    showHint("stop record");
                }else {
                    cameraView.getCameraEngine().startRecordingVideo();
                    showHint("start record");
                }
                isRecording=!isRecording;
            }
        });

        filterListView= (RecyclerView) findViewById(R.id.filter_list);

        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
        linearLayoutManager.setOrientation(LinearLayoutManager.HORIZONTAL);
        filterListView.setLayoutManager(linearLayoutManager);

        List<FilterType> filterTypeList=new ArrayList<>();
        for(int i=0;i<FilterType.values().length;i++){
            filterTypeList.add(FilterType.values()[i]);
            if(i==0) filterTypeList.add(FilterType.NONE);
        }
        FilterAdapter filterAdapter=new FilterAdapter(this,filterTypeList);
        filterListView.setAdapter(filterAdapter);
        filterAdapter.setOnFilterChangeListener(new FilterAdapter.OnFilterChangeListener() {
            @Override
            public void onFilterChanged(FilterType filterType) {
                cameraView.getGlRender().switchLastFilterOfCustomizedFilters(filterType);
            }
        });

        initButtons();
        cameraSettingsFrag= (RelativeLayout) findViewById(R.id.rl_camera_setting_content);
        cameraSettingsFrag.setVisibility(View.GONE);
        cameraActionTip= (ImageView) findViewById(R.id.iv_frag_camera_action_tip);
        bottomControlPanel= (RelativeLayout) findViewById(R.id.bottom_control_panel);

        canUseMediaCodec=
                MediaCodecUtils.checkMediaCodecVideoEncoderSupport()==MediaCodecUtils.CODEC_SUPPORTED
                    &&
                MediaCodecUtils.checkMediaCodecAudioEncoderSupport()==MediaCodecUtils.CODEC_SUPPORTED;
        recordButton.setRecordable(canUseMediaCodec);

        timeCountDownText= (TextView) findViewById(R.id.tv_frag_camera_time_lapse_number);

        HardCodeHelper.decompressAllResource(this);
        effectListView= (RecyclerView) findViewById(R.id.effect_list);

        LinearLayoutManager linearLayoutManager2 = new LinearLayoutManager(this);
        linearLayoutManager2.setOrientation(LinearLayoutManager.HORIZONTAL);

        effectListView.setLayoutManager(linearLayoutManager2);
        EffectAdapter effectAdapter=new EffectAdapter(this, HardCodeData.itemList);
        effectListView.setAdapter(effectAdapter);
        effectAdapter.setOnEffectChangeListener(new EffectAdapter.OnEffectChangeListener() {
            @Override
            public void onFilterChanged(HardCodeData.EffectItem effectItem) {
                doUpdateFilter(effectItem);
            }
        });
        initUIandEvent();
    }
 
Example 20
Source File: SuperSwipeRefreshLayout.java    From android-fly-refreshlayout with Apache License 2.0 4 votes vote down vote up
/**
 * 添加底部布局
 */
private void createFooterViewContainer() {
    mFooterViewContainer = new RelativeLayout(getContext());
    mFooterViewContainer.setVisibility(View.GONE);
    addView(mFooterViewContainer);
}