本文整理汇总了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));
}
示例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);
}
}
示例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));
}
示例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));
}
示例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();
}
}
}
示例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);
}
}
示例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;
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}