当前位置: 首页>>代码示例>>Java>>正文


Java RelativeLayout.setVisibility方法代码示例

本文整理汇总了Java中android.widget.RelativeLayout.setVisibility方法的典型用法代码示例。如果您正苦于以下问题:Java RelativeLayout.setVisibility方法的具体用法?Java RelativeLayout.setVisibility怎么用?Java RelativeLayout.setVisibility使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.widget.RelativeLayout的用法示例。


在下文中一共展示了RelativeLayout.setVisibility方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: buildSubFloor

import android.widget.RelativeLayout; //导入方法依赖的package包/类
/**
 * 直接显示评论
 *
 * @param comment
 * @param index
 * @param group   @return
 */
public View buildSubFloor(Comment comment, int index, ViewGroup group) {
    // to retrieve a LayoutInflater for inflating layout resources in this context
    LayoutInflater inflater = (LayoutInflater) group.getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    // 加载布局文件
    View view = inflater.inflate(R.layout.item_comment_sub, null);
    RelativeLayout show = (RelativeLayout) view.findViewById(R.id.show_sub_floor_content);
    TextView hide_text = (TextView) view.findViewById(R.id.hide_text);


    show.setVisibility(View.VISIBLE);
    hide_text.setVisibility(View.GONE);
    TextView floorNum = (TextView) view.findViewById(R.id.sub_floor_num);
    TextView username = (TextView) view.findViewById(R.id.sub_floor_username);
    TextView content = (TextView) view.findViewById(R.id.sub_floor_content);
    floorNum.setText(String.valueOf(index + 1));
    username.setText(comment.getUser().getNickname());
    content.setText(comment.getContent());
    return view;
}
 
开发者ID:Jay-Ping,项目名称:newIPlay,代码行数:27,代码来源:SubFloorFactory.java

示例2: showSearchInterfaceBar

import android.widget.RelativeLayout; //导入方法依赖的package包/类
private void showSearchInterfaceBar(String text) {

		LightningView wv=getCurrentWebView();
		if(wv==null){
			return;
		}


		mSearchBar = (RelativeLayout) findViewById(R.id.search_bar);
		mSearchBar.setVisibility(View.VISIBLE);

		TextView tw = (TextView) findViewById(R.id.search_query);
		tw.setText("'" + text + "'");

		ImageButton up = (ImageButton) findViewById(R.id.button_next);
		up.setOnClickListener(this);

		ImageButton down = (ImageButton) findViewById(R.id.button_back);
		down.setOnClickListener(this);

		ImageButton quit = (ImageButton) findViewById(R.id.button_quit);
		quit.setOnClickListener(this);
	}
 
开发者ID:Louis19910615,项目名称:youkes_browser,代码行数:24,代码来源:BrowserActivity.java

示例3: onCreate

import android.widget.RelativeLayout; //导入方法依赖的package包/类
@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);


        sharedPreferences= PreferenceManager.getDefaultSharedPreferences(this);

        startLayout= (LinearLayout) findViewById(R.id.startlayout);
        secondLayout= (RelativeLayout) findViewById(R.id.secondlayout);
        relativeLayout= (RelativeLayout) findViewById(R.id.relativelayout);
        imageView= (ImageView) findViewById(R.id.imageview);
        homemsg= (TextView) findViewById(R.id.homemsg);

        if(sharedPreferences.getBoolean("animation",true)){

            homemsg.setVisibility(TextView.INVISIBLE);
            startAnimation();

        }else{

//            startLayout.setVisibility(LinearLayout.INVISIBLE);
            secondLayout.setVisibility(RelativeLayout.VISIBLE);

        }
    }
 
开发者ID:youben11,项目名称:cryptili,代码行数:27,代码来源:MainActivity.java

示例4: enableAds

import android.widget.RelativeLayout; //导入方法依赖的package包/类
private void enableAds() {
    RelativeLayout rlAd = (RelativeLayout) findViewById(R.id.rlAd);
    LinearLayout llAd = (LinearLayout) findViewById(R.id.llAd);
    final AdView adView = (AdView) findViewById(R.id.adView);

    rlAd.setVisibility(View.VISIBLE);
    llAd.setVisibility(View.VISIBLE);

    Handler handler = new Handler();
    handler.postDelayed(new Runnable() {
        @Override
        public void run() {
            try {
                AdRequest adRequest = new AdRequest.Builder()
                        .addTestDevice(getString(R.string.ad_test_device_id))
                        .build();
                adView.loadAd(adRequest);
            } catch (Throwable ex) {
                Log.e(TAG, ex.toString() + "\n" + Log.getStackTraceString(ex));
            }
        }
    }, 1000);
}
 
开发者ID:miankai,项目名称:MKAPP,代码行数:24,代码来源:ActivityMain.java

示例5: init

import android.widget.RelativeLayout; //导入方法依赖的package包/类
private void init(){

        findViewById(R.id.btn_back).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                finish();
            }
        });

        draggerInit();
        initObserval();
        initProgressDialog();

        mTitleView.setText(selectedEmployee.getName());
        img_main = (ImageView)findViewById(R.id.image);
        Picasso.with(getApplicationContext())
                .load(selectedEmployee.getPic())
                .into(img_main);
        img = (ImageView)findViewById(R.id.img);
        Picasso.with(getApplicationContext())
                .load(selectedEmployee.getPic())
                .into(img);

        rl_profile = (RelativeLayout)findViewById(R.id.rl_profile);
        rl_profile.setVisibility(View.GONE);

        li_detail = (LinearLayout)findViewById(R.id.li_detail);
//        makeDetailInfo();

    }
 
开发者ID:pooi,项目名称:Nearby,代码行数:31,代码来源:EmployeeDetailActivity.java

示例6: createView

import android.widget.RelativeLayout; //导入方法依赖的package包/类
@Override
protected View createView() {
    View view = View.inflate(getContext(), R.layout.edit_text_9_16, this);
    edittext = (EditText) view.findViewById(R.id.edit);
    edittext.addTextChangedListener(this);
    clear = (RelativeLayout) view.findViewById(R.id.rel_clear);
    clear.setOnClickListener(this);
    clear.setVisibility(View.GONE);
    return view;
}
 
开发者ID:teisun,项目名称:SunmiUI,代码行数:11,代码来源:Edit.java

示例7: setupViews

import android.widget.RelativeLayout; //导入方法依赖的package包/类
private void setupViews(View rootView) {
    recyclerView_availabilities = (RecyclerView) rootView.findViewById(R.id.recyclerView_availabilities);
    progressBarLoadingData = (ProgressBar) rootView.findViewById(R.id.progressBar_loadingData);
    relativeLayout_noInternet  = (RelativeLayout) rootView.findViewById(R.id.relativeLayout_noInternet);
    relativeLayout_serverError = (RelativeLayout) rootView.findViewById(R.id.relativeLayout_serverError);
    relativeLayout_noData      = (RelativeLayout) rootView.findViewById(R.id.relativeLayout_noAvailabilities);
    //TODO: Remove when API implemented!
    relativeLayout_noData.setVisibility(View.VISIBLE);
    setupRecyclerView();
}
 
开发者ID:ayounes3333,项目名称:GSB-2017-Android,代码行数:11,代码来源:AvailabilityFragment.java

示例8: hideView

import android.widget.RelativeLayout; //导入方法依赖的package包/类
/**
 * 测试TextView消失
 */
public void hideView(){
    RelativeLayout relativeLayout = (RelativeLayout)findViewById(R.id.textView_Layout);
    if (tag){
        relativeLayout.setVisibility(View.GONE);
        tag = false;
    }else {
        relativeLayout.setVisibility(View.VISIBLE);
        tag = true;
    }
}
 
开发者ID:Axe-Ishmael,项目名称:Blockly,代码行数:14,代码来源:LuaActivity.java

示例9: onCreateView

import android.widget.RelativeLayout; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    final View myFragmentView = inflater.inflate(R.layout.fragment_notas, container, false);

    //Obtem da View
    mViewPager = (ViewPager) myFragmentView.findViewById(R.id.vp_tab);
    //Obtem da View
    mRelativeLayout = (RelativeLayout) myFragmentView.findViewById(R.id.pb_nota);

    //Obtem da View
    mTabLayout = (TabLayout) myFragmentView.findViewById(R.id.tl_notas);

    //Verifica se há erros
    if(erro)
    {
        //Mostra a mensagem de erro
        mRelativeLayout.findViewById(R.id.tv_erro).setVisibility(View.VISIBLE);
        mRelativeLayout.findViewById(R.id.pb_nota_indeterminate).setVisibility(View.GONE);
    }
    //Verifica se há faltas
    else if(mNotas==null)
        //Baixa as faltas
        new DownloadNotas(getActivity(),getFragmentManager(),ActivityPrincipal.mAluno.getRm(),mViewPager,mTabLayout,mRelativeLayout).execute(Utils.getUrlApiNota(getActivity()));
    else {
        //Configura e mostra as faltas já obtidas
        setupViewPager(mViewPager, mTabLayout);
        mRelativeLayout.setVisibility(View.GONE);
        mTabLayout.setVisibility(View.VISIBLE);
        mViewPager.setVisibility(View.VISIBLE);
    }

    return myFragmentView;
}
 
开发者ID:alessandrojean,项目名称:order-by-android,代码行数:35,代码来源:NotasFragment.java

示例10: onCreateView

import android.widget.RelativeLayout; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    final View myFragmentView = inflater.inflate(R.layout.fragment_faltas, container, false);

    //Obtem da View
    mViewPager = (ViewPager) myFragmentView.findViewById(R.id.vp_tab);
    //Obtem da View
    mRelativeLayout = (RelativeLayout) myFragmentView.findViewById(R.id.pb_falta);

    //Obtem da View
    mTabLayout = (TabLayout) myFragmentView.findViewById(R.id.tl_faltas);

    //Verifica se há erros
    if(erro)
    {
        //Mostra a mensagem de erro
        mRelativeLayout.findViewById(R.id.tv_erro).setVisibility(View.VISIBLE);
        mRelativeLayout.findViewById(R.id.pb_falta_indeterminate).setVisibility(View.GONE);
    }
    //Verifica se há faltas
    else if(mFaltas==null)
        //Baixa as faltas
        new DownloadFaltas(getActivity(),getFragmentManager(),ActivityPrincipal.mAluno.getRm(),mViewPager,mTabLayout,mRelativeLayout).execute(Utils.getUrlApiFalta(getActivity()));
    else {
        //Configura e mostra as faltas já obtidas
        setupViewPager(mViewPager, mTabLayout);
        mRelativeLayout.setVisibility(View.GONE);
        mTabLayout.setVisibility(View.VISIBLE);
        mViewPager.setVisibility(View.VISIBLE);
    }

    return myFragmentView;
}
 
开发者ID:alessandrojean,项目名称:order-by-android,代码行数:35,代码来源:FaltasFragment.java

示例11: onCreate

import android.widget.RelativeLayout; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_safe);
    rl_support_finger = (RelativeLayout) findViewById(R.id.rl_support_finger);
    rl_unsupport_finger = (RelativeLayout) findViewById(R.id.rl_unsupport_finger);
    btn_open = (Button) findViewById(R.id.btn_open);
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    toolbar.setTitle("安全验证");
    setSupportActionBar(toolbar);
    //        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {//sdk23以下的版本直接数字码验证
        codeCheck();
        tv_message.setText("当前设备版本过低,请使用6位数字码进行安全验证");
    } else {//SDK23以上显示指纹
        fingerCheck();
        if (code != 999) {
            codeCheck();
            if (code == PERMISSION_DENIED_ERROE) {
                tv_message.setText("当前没有指纹权限,将使用6位数字码进行安全验证或在设置中授权后重试");
            } else if (code == HARDWARE_MISSIING_ERROR) {
                tv_message.setText("当前没有指纹模块,将使用6位数字码进行安全验证");
            } else if (code == KEYGUARDSECURE_MISSIING_ERROR) {
                tv_message.setText("当前没有设置锁屏密码,将使用6位数字码进行安全验证");
            } else if (code == NO_FINGERPRINTERS_ENROOLED_ERROR) {
                tv_message.setText("当前没有指纹录入,将使用6位数字码进行安全验证或在设置中录入指纹后重试");
            } else if (code == FINGERPRINTERS_FAILED_ERROR) {
                tv_message.setText("指纹认证失败,将使用6位数字码进行安全验证");
            }
        } else {
            rl_unsupport_finger.setVisibility(View.GONE);
            rl_support_finger.setVisibility(View.VISIBLE);
        }
    }

    ThemeUtils.initStatusBarColor(SafeActivity.this, ThemeUtils.getPrimaryDarkColor(SafeActivity.this));

}
 
开发者ID:paradoxie,项目名称:DizzyPassword,代码行数:39,代码来源:SafeActivity.java

示例12: updateIndicator

import android.widget.RelativeLayout; //导入方法依赖的package包/类
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);
        }
    }
}
 
开发者ID:zuoweitan,项目名称:Hitalk,代码行数:31,代码来源:EmojiconIndicatorView.java

示例13: onCreateView

import android.widget.RelativeLayout; //导入方法依赖的package包/类
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
                         @Nullable Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.main_fragment, container, false);
    mUtil = new Util(getContext());
    initViews(view);
    initSpinner();
    listenButtonEvent();
    mFetchMessageLayout = (RelativeLayout) view.findViewById(R.id.fetching_message_layout);
    mMainFramentComponentsLayout = (RelativeLayout) view.findViewById(R.id.main_fragment_components);

    mSearchBox.setOnKeyListener(new View.OnKeyListener() {
        @Override
        public boolean onKey(View v, int keyCode, KeyEvent event) {
            if (keyCode == KeyEvent.KEYCODE_ENTER && event.getAction() == KeyEvent.ACTION_UP) {
                mSearchQuery = mSearchBox.getText().toString();
                String searchScope = mStringSearchScope;
                mainFragmentListener.getSearchInfo(mSearchQuery, searchScope);
                return true;
            } else return false;
        }
    });

    if (mUtil.isNetworkOnline()) {
        new UrlFetchTask().execute(
                rootUrl + fileNames[0],
                rootUrl + fileNames[1],
                rootUrl + fileNames[2],
                rootUrl + fileNames[3],
                rootUrl + fileNames[4]
        );
    } else {
        mFetchMessageLayout.setVisibility(View.GONE);
        Toast.makeText(getContext(), "Please Connect to the internet and restart the app.", Toast.LENGTH_SHORT).show();
    }
    return view;
}
 
开发者ID:CamelCase11,项目名称:Search-em-All,代码行数:39,代码来源:MainFragment.java

示例14: toggleSelection

import android.widget.RelativeLayout; //导入方法依赖的package包/类
private void toggleSelection(int position) {
    mAdapterPreparation.toggleSelection(position);
    final RelativeLayout rlShare = (RelativeLayout) findViewById(R.id.rl_share);
    if (position == mAdapterPreparation.getItemCount()-1) {

        Log.d("selected", "toggleSelection: "+position+" "+(mAdapterPreparation.getItemCount()-1));
        rlShare.setVisibility(View.VISIBLE);
    }
}
 
开发者ID:ahmadnurhidayat,项目名称:Cook-It-Android-XML-Template,代码行数:10,代码来源:Detail.java

示例15: showExitHintLayout

import android.widget.RelativeLayout; //导入方法依赖的package包/类
@Override
public void showExitHintLayout() {
    findViewById(R.id.rl_map_btn_container).setVisibility(View.GONE);
    findViewById(R.id.ll_text_container).setVisibility(View.GONE);
    RelativeLayout trackExitHint = (RelativeLayout) findViewById(R.id.rl_track_exit_hint_container);
    trackExitHint.setVisibility(View.VISIBLE);
    findViewById(R.id.btn_finish).setOnClickListener(this);
    findViewById(R.id.btn_share).setOnClickListener(this);
    mTrackPresenter.showMapUiLayout(MovementTrackActivity.this, mRlMapUiContainer, getFragmentManager().findFragmentById(R.id.map));
    mTrackPresenter.scaleCurrentCamera();
}
 
开发者ID:stdnull,项目名称:RunMap,代码行数:12,代码来源:MovementTrackActivity.java


注:本文中的android.widget.RelativeLayout.setVisibility方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。