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


Java FlexboxLayout.getChildCount方法代码示例

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


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

示例1: testConfigurationChange

import com.google.android.flexbox.FlexboxLayout; //导入方法依赖的package包/类
@Test
@FlakyTest(tolerance = TOLERANCE)
public void testConfigurationChange() {
    MainActivity activity = mActivityRule.getActivity();
    FlexboxLayout flexboxLayout = (FlexboxLayout) activity.findViewById(R.id.flexbox_layout);
    assertNotNull(flexboxLayout);
    onView(withId(R.id.add_fab)).perform(click());
    onView(withId(R.id.add_fab)).perform(click());
    int beforeCount = flexboxLayout.getChildCount();

    activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
    InstrumentationRegistry.getInstrumentation().waitForIdleSync();

    // Verify the flex items are restored across the configuration change.
    assertThat(flexboxLayout.getChildCount(), is(beforeCount));
}
 
开发者ID:canceel,项目名称:flexboxlayout,代码行数:17,代码来源:MainActivityTest.java

示例2: verif

import com.google.android.flexbox.FlexboxLayout; //导入方法依赖的package包/类
public void verif(View view){

        findViewById(R.id.imageButton114).setVisibility(View.VISIBLE);
        findViewById(R.id.button7).setVisibility(View.GONE);

        FlexboxLayout flexboxLayout = (FlexboxLayout) findViewById(R.id.flexTop);
        int count = flexboxLayout.getChildCount();
        int laco=0;
        for(int i =0;i<count;i++){
            View v = flexboxLayout.getChildAt(i);
            laco++;
            if(laco==1){
                if(v==findViewById(R.id.button28)){
                    cont++;
                }
            }else if(laco==2){
                if(v==findViewById(R.id.button19)){
                    cont++;
                }
            }else if(laco==3){
                if(v==findViewById(R.id.button23)){
                    cont++;
                }
            }else if(laco==4){
                if(v==findViewById(R.id.button21)){
                    cont++;
                }
            }else if(laco==5){
                if(v==findViewById(R.id.button25)){
                    cont++;
                }
            }else if(laco==6){
                if(v==findViewById(R.id.button22)){
                    cont++;
                }
            }else if(laco==7){
                if(v==findViewById(R.id.button24)){
                    cont++;
                }
            }




        }
        ImageView imageView = (ImageView) findViewById(R.id.imageView63);
        if(cont>=7){

            findViewById(R.id.textView248).setVisibility(View.VISIBLE);
            findViewById(R.id.textView249).setVisibility(View.GONE);
            imageView.setVisibility(View.VISIBLE);

            findViewById(R.id.flexDown).setVisibility(View.GONE);






        }else{

            findViewById(R.id.textView248).setVisibility(View.GONE);
            imageView.setImageResource(R.drawable.sad);
            imageView.setVisibility(View.VISIBLE);
            findViewById(R.id.textView249).setVisibility(View.VISIBLE);
            findViewById(R.id.flexDown).setVisibility(View.GONE);
        }
    }
 
开发者ID:jvbeltra,项目名称:JavaIsFun,代码行数:69,代码来源:LacoDeRepeticao6.java

示例3: testAddFlexItem

import com.google.android.flexbox.FlexboxLayout; //导入方法依赖的package包/类
@Test
@FlakyTest(tolerance = TOLERANCE)
public void testAddFlexItem() {
    MainActivity activity = mActivityRule.getActivity();
    FlexboxLayout flexboxLayout = (FlexboxLayout) activity.findViewById(R.id.flexbox_layout);
    assertNotNull(flexboxLayout);
    int beforeCount = flexboxLayout.getChildCount();
    onView(withId(R.id.add_fab)).perform(click());

    assertThat(flexboxLayout.getChildCount(), is(beforeCount + 1));
}
 
开发者ID:canceel,项目名称:flexboxlayout,代码行数:12,代码来源:MainActivityTest.java

示例4: testRemoveFlexItem

import com.google.android.flexbox.FlexboxLayout; //导入方法依赖的package包/类
@Test
@FlakyTest(tolerance = TOLERANCE)
public void testRemoveFlexItem() {
    MainActivity activity = mActivityRule.getActivity();
    FlexboxLayout flexboxLayout = (FlexboxLayout) activity.findViewById(R.id.flexbox_layout);
    assertNotNull(flexboxLayout);
    int beforeCount = flexboxLayout.getChildCount();
    onView(withId(R.id.remove_fab)).perform(click());

    assertThat(flexboxLayout.getChildCount(), is(beforeCount - 1));
}
 
开发者ID:canceel,项目名称:flexboxlayout,代码行数:12,代码来源:MainActivityTest.java

示例5: hidePassphrase

import com.google.android.flexbox.FlexboxLayout; //导入方法依赖的package包/类
private void hidePassphrase(final boolean isHidden) {
    final FlexboxLayout wrapper = findViewById(R.id.wrapper);
    for (int i = 0; i < wrapper.getChildCount(); i++) {
        final SuggestionInputView suggestionInputView = (SuggestionInputView) wrapper.getChildAt(i);
        if (isHidden) {
            suggestionInputView.getTagView().hideText();
        } else {
            suggestionInputView.getTagView().showText();
        }
    }
}
 
开发者ID:toshiapp,项目名称:toshi-android-client,代码行数:12,代码来源:PassphraseInputView.java

示例6: initCellListeners

import com.google.android.flexbox.FlexboxLayout; //导入方法依赖的package包/类
private void initCellListeners() {
    final FlexboxLayout wrapper = findViewById(R.id.wrapper);
    for (int i = 0; i < wrapper.getChildCount(); i++) {
        final SuggestionInputView inputView = (SuggestionInputView) wrapper.getChildAt(i);
        inputView.setOnClickListener(this::handleCellClicked);
        inputView.getWordView().setOnFocusChangeListener(this::handleCellFocusChanged);
    }
}
 
开发者ID:toshiapp,项目名称:toshi-android-client,代码行数:9,代码来源:PassphraseInputView.java

示例7: getIndexOfView

import com.google.android.flexbox.FlexboxLayout; //导入方法依赖的package包/类
private int getIndexOfView(final SuggestionInputView view) {
    final FlexboxLayout wrapper = findViewById(R.id.wrapper);
    for (int i = 0; i < wrapper.getChildCount(); i++) {
        final View inputView = wrapper.getChildAt(i);
        if (inputView.getId() == view.getId()) {
            return i;
        }
    }
    return 0;
}
 
开发者ID:toshiapp,项目名称:toshi-android-client,代码行数:11,代码来源:PassphraseInputView.java

示例8: initListeners

import com.google.android.flexbox.FlexboxLayout; //导入方法依赖的package包/类
private void initListeners() {
    final FlexboxLayout sourceLayout = (FlexboxLayout) findViewById(R.id.remaining_phrases);
    for (int i = 0; i < sourceLayout.getChildCount(); i++) {
        final DraggableShadowTextView remainingPhraseView = (DraggableShadowTextView) sourceLayout.getChildAt(i);
        remainingPhraseView.setListener(this.clickAndDragListener);
        remainingPhraseView.setOnDragListener(this::handleDragEvent);
    }

    final FlexboxLayout targetLayout = (FlexboxLayout) findViewById(R.id.user_inputted_phrases);
    for (int i = 0; i < targetLayout.getChildCount(); i++) {
        final DraggableShadowTextView inputtedPhraseView = (DraggableShadowTextView) targetLayout.getChildAt(i);
        inputtedPhraseView.setListener(this.clickAndDragListener);
        inputtedPhraseView.setOnDragListener(this::handleDragEvent);
    }
}
 
开发者ID:toshiapp,项目名称:toshi-android-client,代码行数:16,代码来源:DragAndDropView.java

示例9: renderRemainingInputPhrases

import com.google.android.flexbox.FlexboxLayout; //导入方法依赖的package包/类
private void renderRemainingInputPhrases() {
    final FlexboxLayout gridLayout = (FlexboxLayout) findViewById(R.id.remaining_phrases);
    for (int i = 0; i < gridLayout.getChildCount(); i++) {
        final DraggableShadowTextView backupPhraseWord = (DraggableShadowTextView) gridLayout.getChildAt(i);
        final String remainingPhrase = this.remainingInputBackupPhrase.get(i);
        setText(backupPhraseWord, remainingPhrase);
    }
}
 
开发者ID:toshiapp,项目名称:toshi-android-client,代码行数:9,代码来源:DragAndDropView.java

示例10: verif

import com.google.android.flexbox.FlexboxLayout; //导入方法依赖的package包/类
public void verif(View view){

        findViewById(R.id.imageButton149).setVisibility(View.VISIBLE);
        findViewById(R.id.button17).setVisibility(View.GONE);

        FlexboxLayout flexboxLayout = (FlexboxLayout) findViewById(R.id.flexTop);
        int count = flexboxLayout.getChildCount();
        int laco=0;
        for(int i =0;i<count;i++){
            View v = flexboxLayout.getChildAt(i);
            laco++;
            if(laco==1){
                if(v==findViewById(R.id.button28)){
                    cont++;
                }
            }else if(laco==2){
                if(v==findViewById(R.id.button19)){
                    cont++;
                }
            }else if(laco==3){
                if(v==findViewById(R.id.button23)){
                    cont++;
                }
            }else if(laco==4){
                if(v==findViewById(R.id.button21)){
                    cont++;
                }
            }else if(laco==5){
                if(v==findViewById(R.id.button25)){
                    cont++;
                }

            }else if(laco==6){
                if(v==findViewById(R.id.button22)){
                    cont++;
                }
            }else if(laco==7){
                if(v==findViewById(R.id.button24)){
                    cont++;
                }
            }




        }
        ImageView imageView = (ImageView) findViewById(R.id.imageView67);
        if(cont>=7){
            findViewById(R.id.textView317).setVisibility(View.VISIBLE);
            findViewById(R.id.textView318).setVisibility(View.GONE);
            findViewById(R.id.flexDown).setVisibility(View.GONE);
            imageView.setVisibility(View.VISIBLE);
            imageView.setImageResource(R.drawable.checkmarkred);





        }else{
            findViewById(R.id.textView317).setVisibility(View.GONE);
            findViewById(R.id.textView318).setVisibility(View.VISIBLE);
            imageView.setImageResource(R.drawable.sad);
            imageView.setVisibility(View.VISIBLE);
            findViewById(R.id.flexDown).setVisibility(View.GONE);
        }
    }
 
开发者ID:jvbeltra,项目名称:JavaIsFun,代码行数:67,代码来源:Vetores9.java

示例11: verif

import com.google.android.flexbox.FlexboxLayout; //导入方法依赖的package包/类
public void verif(View view){

        findViewById(R.id.imageButton147).setVisibility(View.VISIBLE);
        findViewById(R.id.button16).setVisibility(View.GONE);

        FlexboxLayout flexboxLayout = (FlexboxLayout) findViewById(R.id.flexTop);
        int count = flexboxLayout.getChildCount();
        int laco=0;
        for(int i =0;i<count;i++){
            View v = flexboxLayout.getChildAt(i);
            laco++;
            if(laco==1){
                if(v==findViewById(R.id.button28)){
                    cont++;
                }
                if(v==findViewById(R.id.button25)){
                    cont++;
                }
            }else if(laco==2){
                if(v==findViewById(R.id.button19)){
                    cont++;
                }
            }else if(laco==3){
                if(v==findViewById(R.id.button23)){
                    cont++;
                }
            }else if(laco==4){
                if(v==findViewById(R.id.button21)){
                    cont++;
                }
            }else if(laco==5){
                if(v==findViewById(R.id.button25)){
                    cont++;
                }
                if(v==findViewById(R.id.button28)){
                    cont++;
                }
            }else if(laco==6){
                if(v==findViewById(R.id.button22)){
                    cont++;
                }
            }else if(laco==7){
                if(v==findViewById(R.id.button24)){
                    cont++;
                }
            }




        }
        ImageView imageView = (ImageView) findViewById(R.id.imageView68);

        if(cont>=7){
            findViewById(R.id.textView313).setVisibility(View.VISIBLE);
            findViewById(R.id.textView314).setVisibility(View.GONE);
            imageView.setVisibility(View.VISIBLE);
            imageView.setImageResource(R.drawable.checkmarkred);
            findViewById(R.id.flexDown).setVisibility(View.GONE);






        }else{
            findViewById(R.id.textView313).setVisibility(View.GONE);
            findViewById(R.id.textView314).setVisibility(View.VISIBLE);
            imageView.setImageResource(R.drawable.sad);
            imageView.setVisibility(View.VISIBLE);
            findViewById(R.id.flexDown).setVisibility(View.GONE);
        }
    }
 
开发者ID:jvbeltra,项目名称:JavaIsFun,代码行数:74,代码来源:Vetores8.java

示例12: verif

import com.google.android.flexbox.FlexboxLayout; //导入方法依赖的package包/类
public void verif(View view){

        findViewById(R.id.imageButton81).setVisibility(View.VISIBLE);
        findViewById(R.id.button31).setVisibility(View.GONE);

        FlexboxLayout flexboxLayout = (FlexboxLayout) findViewById(R.id.flexTop);
        int count = flexboxLayout.getChildCount();
        int laco=0;
        for(int i =0;i<count;i++){
            View v = flexboxLayout.getChildAt(i);
            laco++;
            if(laco==1){
                if(v==findViewById(R.id.button28)){
                    cont++;
                }
            }else if(laco==2){
                if(v==findViewById(R.id.button19)){
                    cont++;
                }
            }else if(laco==3){
                if(v==findViewById(R.id.button23)){
                    cont++;
                }
            }else if(laco==4){
                if(v==findViewById(R.id.button21)){
                    cont++;
                }
            }else if(laco==5){
                if(v==findViewById(R.id.button25)){
                    cont++;
                }
            }else if(laco==6){
                if(v==findViewById(R.id.button22)){
                    cont++;
                }
            }else if(laco==7){
                if(v==findViewById(R.id.button24)){
                    cont++;
                }
            }


        }
        ImageView imageView = (ImageView) findViewById(R.id.imageView61);
        if(cont>=7){
            findViewById(R.id.textView203).setVisibility(View.VISIBLE);
            findViewById(R.id.textView205).setVisibility(View.GONE);
            imageView.setVisibility(View.VISIBLE);
            findViewById(R.id.flexDown).setVisibility(View.GONE);






        }else{
            findViewById(R.id.textView203).setVisibility(View.GONE);
            findViewById(R.id.textView205).setVisibility(View.VISIBLE);
            findViewById(R.id.flexDown).setVisibility(View.GONE);
            imageView.setImageResource(R.drawable.sad);
            imageView.setVisibility(View.VISIBLE);
        }
    }
 
开发者ID:jvbeltra,项目名称:JavaIsFun,代码行数:64,代码来源:Calculos8.java

示例13: verif

import com.google.android.flexbox.FlexboxLayout; //导入方法依赖的package包/类
public void verif(View view){

        findViewById(R.id.imageButton77).setVisibility(View.VISIBLE);
        findViewById(R.id.button30).setVisibility(View.GONE);

        FlexboxLayout flexboxLayout = (FlexboxLayout) findViewById(R.id.flexTop);
        int count = flexboxLayout.getChildCount();
        int laco=0;
        for(int i =0;i<count;i++){
            View v = flexboxLayout.getChildAt(i);
            laco++;
            if(laco==1){
                if(v==findViewById(R.id.button28)){
                    cont++;
                }
            }else if(laco==2){
                if(v==findViewById(R.id.button19)){
                    cont++;
                }
            }else if(laco==3){
                if(v==findViewById(R.id.button23)){
                    cont++;
                }
            }else if(laco==4){
                if(v==findViewById(R.id.button21)){
                    cont++;
                }
            }else if(laco==5){
                if(v==findViewById(R.id.button25)){
                    cont++;
                }
            }else if(laco==6){
                if(v==findViewById(R.id.button22)){
                    cont++;
                }
            }else if(laco==7){
                if(v==findViewById(R.id.button24)){
                    cont++;
                }
            }


        }
        ImageView imageView = (ImageView) findViewById(R.id.imageView60);
        if(cont>=7){
            findViewById(R.id.textView192).setVisibility(View.VISIBLE);
            findViewById(R.id.textView193).setVisibility(View.GONE);
            imageView.setVisibility(View.VISIBLE);
            findViewById(R.id.flexDown).setVisibility(View.GONE);






        }else{
            findViewById(R.id.textView192).setVisibility(View.GONE);
            findViewById(R.id.textView193).setVisibility(View.VISIBLE);
            imageView.setImageResource(R.drawable.sad);
            imageView.setVisibility(View.VISIBLE);
            findViewById(R.id.flexDown).setVisibility(View.GONE);
        }
    }
 
开发者ID:jvbeltra,项目名称:JavaIsFun,代码行数:64,代码来源:Calculos7.java

示例14: verif

import com.google.android.flexbox.FlexboxLayout; //导入方法依赖的package包/类
public void verif(View view){

        findViewById(R.id.imageButton71).setVisibility(View.VISIBLE);
        findViewById(R.id.button20).setVisibility(View.GONE);

        FlexboxLayout flexboxLayout = (FlexboxLayout) findViewById(R.id.flexTop);
        int count = flexboxLayout.getChildCount();
        int laco=0;
        for(int i =0;i<count;i++){
            View v = flexboxLayout.getChildAt(i);
            laco++;
            if(laco==1){
                if(v==findViewById(R.id.button28)){
                    cont++;
                }
            }else if(laco==2){
                if(v==findViewById(R.id.button19)){
                    cont++;
                }
            }else if(laco==3){
                if(v==findViewById(R.id.button23)){
                    cont++;
                }
            }else if(laco==4){
                if(v==findViewById(R.id.button21)){
                    cont++;
                }
            }else if(laco==5){
                if(v==findViewById(R.id.button25)){
                    cont++;
                }
            }else if(laco==6){
                if(v==findViewById(R.id.button22)){
                    cont++;
                }
            }else if(laco==7){
                if(v==findViewById(R.id.button24)){
                    cont++;
                }
            }




        }
        ImageView imageView = (ImageView) findViewById(R.id.imageView59);

        if(cont>=7){
            findViewById(R.id.textView189).setVisibility(View.VISIBLE);
            findViewById(R.id.textView186).setVisibility(View.GONE);
            imageView.setVisibility(View.VISIBLE);
            findViewById(R.id.flexDown).setVisibility(View.GONE);






        }else{
            findViewById(R.id.textView189).setVisibility(View.GONE);
            imageView.setImageResource(R.drawable.sad);
            imageView.setVisibility(View.VISIBLE);
            findViewById(R.id.textView186).setVisibility(View.VISIBLE);
            findViewById(R.id.flexDown).setVisibility(View.GONE);
        }
    }
 
开发者ID:jvbeltra,项目名称:JavaIsFun,代码行数:67,代码来源:Calculos6.java

示例15: verif

import com.google.android.flexbox.FlexboxLayout; //导入方法依赖的package包/类
public void verif(View view) {

        findViewById(R.id.imageButton190).setVisibility(View.VISIBLE);
        findViewById(R.id.button34).setVisibility(View.GONE);

        FlexboxLayout flexboxLayout = (FlexboxLayout) findViewById(R.id.flexTop);
        int count = flexboxLayout.getChildCount();
        int laco = 0;
        for (int i = 0; i < count; i++) {
            View v = flexboxLayout.getChildAt(i);
            laco++;
            if (laco == 1) {
                if (v == findViewById(R.id.button28)) {
                    cont++;
                }
                if (v == findViewById(R.id.button25)) {
                    cont++;
                }
            } else if (laco == 2) {
                if (v == findViewById(R.id.button19)) {
                    cont++;
                }
            } else if (laco == 3) {
                if (v == findViewById(R.id.button23)) {
                    cont++;
                }
            } else if (laco == 4) {
                if (v == findViewById(R.id.button21)) {
                    cont++;
                }
            } else if (laco == 5) {
                if (v == findViewById(R.id.button25)) {
                    cont++;
                }
                if (v == findViewById(R.id.button28)) {
                    cont++;
                }
            } else if (laco == 6) {
                if (v == findViewById(R.id.button22)) {
                    cont++;
                }
            } else if (laco == 7) {
                if (v == findViewById(R.id.button29)) {
                    cont++;
                }
            } else if (laco == 8) {
                if (v == findViewById(R.id.button24)) {
                    cont++;
                }
            }


        }
        ImageView imageView = (ImageView) findViewById(R.id.imageView73);

        if (cont >= 8) {
            findViewById(R.id.textView448).setVisibility(View.VISIBLE);
            findViewById(R.id.textView449).setVisibility(View.GONE);
            imageView.setVisibility(View.VISIBLE);
            imageView.setImageResource(R.drawable.checkmarkred);
            findViewById(R.id.flexDown).setVisibility(View.GONE);


        } else {
            findViewById(R.id.textView448).setVisibility(View.GONE);
            findViewById(R.id.textView449).setVisibility(View.VISIBLE);
            imageView.setImageResource(R.drawable.sad);
            imageView.setVisibility(View.VISIBLE);
            findViewById(R.id.flexDown).setVisibility(View.GONE);
        }
    }
 
开发者ID:jvbeltra,项目名称:JavaIsFun,代码行数:72,代码来源:Matrizes6.java


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