本文整理汇总了Java中com.google.android.flexbox.FlexboxLayout.getChildAt方法的典型用法代码示例。如果您正苦于以下问题:Java FlexboxLayout.getChildAt方法的具体用法?Java FlexboxLayout.getChildAt怎么用?Java FlexboxLayout.getChildAt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.android.flexbox.FlexboxLayout
的用法示例。
在下文中一共展示了FlexboxLayout.getChildAt方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testLoadFromLayoutXml
import com.google.android.flexbox.FlexboxLayout; //导入方法依赖的package包/类
@Test
@FlakyTest(tolerance = TOLERANCE)
public void testLoadFromLayoutXml() throws Throwable {
final FlexboxTestActivity activity = mActivityRule.getActivity();
mActivityRule.runOnUiThread(new Runnable() {
@Override
public void run() {
activity.setContentView(R.layout.activity_simple);
}
});
FlexboxLayout flexboxLayout = (FlexboxLayout) activity.findViewById(R.id.flexbox_layout);
assertNotNull(flexboxLayout);
assertThat(flexboxLayout.getFlexDirection(), is(FlexboxLayout.FLEX_DIRECTION_ROW_REVERSE));
assertThat(flexboxLayout.getJustifyContent(), is(FlexboxLayout.JUSTIFY_CONTENT_CENTER));
assertThat(flexboxLayout.getAlignContent(), is(FlexboxLayout.ALIGN_CONTENT_CENTER));
assertThat(flexboxLayout.getAlignItems(), is(FlexboxLayout.ALIGN_ITEMS_CENTER));
assertThat(flexboxLayout.getChildCount(), is(1));
View child = flexboxLayout.getChildAt(0);
FlexboxLayout.LayoutParams lp = (FlexboxLayout.LayoutParams) child.getLayoutParams();
assertThat(lp.order, is(2));
assertThat(lp.flexGrow, is(1f));
assertThat(lp.alignSelf, is(FlexboxLayout.LayoutParams.ALIGN_SELF_STRETCH));
}
示例2: addValidatedPassphraseToView
import com.google.android.flexbox.FlexboxLayout; //导入方法依赖的package包/类
private void addValidatedPassphraseToView(final List<Pair<Boolean, String>> validatedPassphrase) {
if (validatedPassphrase.size() == 0) return;
final FlexboxLayout wrapper = findViewById(R.id.wrapper);
for (int i = 0; i < validatedPassphrase.size(); i++) {
final SuggestionInputView inputView = (SuggestionInputView) wrapper.getChildAt(i);
final String word = validatedPassphrase.get(i).second;
final boolean isApproved = validatedPassphrase.get(i).first;
if (isApproved) {
inputView.showTagView(word);
addWordToPassphraseList(word, i);
} else {
inputView.showInputView(word);
addWordToPassphraseList(null, i);
}
inputView.setVisibility(VISIBLE);
}
checkIfPassphraseIsApproved();
this.currentCell = validatedPassphrase.size() - 1;
findViewById(R.id.hint).setVisibility(GONE);
}
示例3: 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);
}
}
示例4: reAddWordsToInputViews
import com.google.android.flexbox.FlexboxLayout; //导入方法依赖的package包/类
private void reAddWordsToInputViews() {
if (this.passphraseList.size() == 0) return;
final FlexboxLayout wrapper = findViewById(R.id.wrapper);
for (int i = 0; i < this.passphraseList.size(); i++) {
final SuggestionInputView inputView = (SuggestionInputView) wrapper.getChildAt(i);
final String word = this.passphraseList.get(i);
if (word != null) {
inputView.showTagView(word);
} else {
inputView.showInputView(null);
}
inputView.setVisibility(VISIBLE);
}
checkIfPassphraseIsApproved();
}
示例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: renderUserInputtedPhrases
import com.google.android.flexbox.FlexboxLayout; //导入方法依赖的package包/类
private void renderUserInputtedPhrases() {
final FlexboxLayout backupPhraseTargetLayout = (FlexboxLayout) findViewById(R.id.user_inputted_phrases);
for (int i = 0; i < this.userInputtedBackupPhrase.size(); i++) {
final DraggableShadowTextView backupPhraseTarget = (DraggableShadowTextView) backupPhraseTargetLayout.getChildAt(i);
final String inputtedPhrase = this.userInputtedBackupPhrase.get(i);
setText(backupPhraseTarget, inputtedPhrase);
}
}
示例10: 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);
}
}
示例11: 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);
}
}
示例12: 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);
}
}
示例13: 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);
}
}
示例14: 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);
}
}
示例15: 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);
}
}