android.widget.TextView#setTextAlignment ( )源码实例Demo

下面列出了android.widget.TextView#setTextAlignment ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: GNSS_Compare   文件: MainViewer.java
/**
 * Factory method to initialize each text view and add it to the layout
 * @param view text view to be initialized
 * @param layout layout to which the view is to be added
 * @param columnId column of the layout to which the view is to be added
 */
private void initializeTextView(
        TextView view,
        GridLayout layout,
        int columnId){

    layout.addView(view);

    GridLayout.LayoutParams param = new GridLayout.LayoutParams();
    param.height = GridLayout.LayoutParams.WRAP_CONTENT;
    param.width = GridLayout.LayoutParams.WRAP_CONTENT;
    param.rightMargin = 5;
    param.topMargin = 5;
    view.setTextSize(11);
    view.setWidth(TEXT_FIELD_WIDTH[columnId]);
    view.setTextAlignment(View.TEXT_ALIGNMENT_CENTER);
    param.setGravity(Gravity.CENTER);
    param.columnSpec = GridLayout.spec(columnId);
    param.rowSpec = GridLayout.spec(rowId);
    view.setLayoutParams (param);
}
 
源代码2 项目: GNSS_Compare   文件: MainViewer.java
private void initializeTextView(
        TextView view,
        GridLayout layout,
        int columnId){

    layout.addView(view);

    GridLayout.LayoutParams param = new GridLayout.LayoutParams();
    param.height = GridLayout.LayoutParams.WRAP_CONTENT;
    param.width = GridLayout.LayoutParams.WRAP_CONTENT;
    param.rightMargin = 5;
    param.topMargin = 5;
    view.setTextSize(11);
    view.setWidth(TEXT_FIELD_WIDTH[columnId]);
    view.setTextAlignment(View.TEXT_ALIGNMENT_CENTER);
    param.setGravity(Gravity.CENTER);
    param.columnSpec = GridLayout.spec(columnId);
    param.rowSpec = GridLayout.spec(rowId);
    view.setLayoutParams (param);
}
 
源代码3 项目: Ruisi   文件: MyBottomTab.java
private View getSingleTab(int position) {
    LinearLayout view = new LinearLayout(getContext());
    view.setClickable(true);
    view.setGravity(Gravity.CENTER);
    view.setBackgroundResource(CLICK_BG_RES);
    view.setOrientation(LinearLayout.VERTICAL);

    //图标
    ImageView iconView = new ImageView(getContext());
    //三个参数的构造可以设置权重
    iconView.setLayoutParams(new LayoutParams(SIZE_ICON, SIZE_ICON));
    iconView.setImageResource(iconsUnselect[position]);
    iconView.setColorFilter(COLOR_UNSELECT);
    //标题
    TextView textView = new TextView(getContext());
    textView.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
    textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 12);
    textView.setTextAlignment(TEXT_ALIGNMENT_CENTER);
    textView.setGravity(Gravity.CENTER);
    textView.setTextColor(COLOR_UNSELECT);
    textView.setText(tabNames[position]);
    view.addView(iconView);
    view.addView(textView);
    // 返回布局视图
    return view;
}
 
源代码4 项目: PicKing   文件: SnackbarUtils.java
/**
 * 设置TextView(@+id/snackbar_text)中文字的对齐方式 居中
 *
 * @return
 */
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
public SnackbarUtils messageCenter() {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
        if (getSnackbar() != null) {
            TextView message = (TextView) getSnackbar().getView().findViewById(R.id.snackbar_text);
            //View.setTextAlignment需要SDK>=17
            message.setTextAlignment(View.TEXT_ALIGNMENT_GRAVITY);
            message.setGravity(Gravity.CENTER);
        }
    }
    return this;
}
 
源代码5 项目: PicKing   文件: SnackbarUtils.java
/**
 * 设置TextView(@+id/snackbar_text)中文字的对齐方式 居右
 *
 * @return
 */
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
public SnackbarUtils messageRight() {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
        if (getSnackbar() != null) {
            TextView message = (TextView) getSnackbar().getView().findViewById(R.id.snackbar_text);
            //View.setTextAlignment需要SDK>=17
            message.setTextAlignment(View.TEXT_ALIGNMENT_GRAVITY);
            message.setGravity(Gravity.CENTER_VERTICAL | Gravity.RIGHT);
        }
    }
    return this;
}
 
源代码6 项目: SweetTips   文件: SnackbarUtils.java
/**
 * 设置TextView(@+id/snackbar_text)中文字的对齐方式 居中
 * @return
 */
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
public SnackbarUtils messageCenter(){
    if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1){
        if(getSnackbar()!=null){
            TextView message = (TextView) getSnackbar().getView().findViewById(R.id.snackbar_text);
            //View.setTextAlignment需要SDK>=17
            message.setTextAlignment(View.TEXT_ALIGNMENT_GRAVITY);
            message.setGravity(Gravity.CENTER);
        }
    }
    return this;
}
 
源代码7 项目: SweetTips   文件: SnackbarUtils.java
/**
 * 设置TextView(@+id/snackbar_text)中文字的对齐方式 居右
 * @return
 */
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
public SnackbarUtils messageRight(){
    if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1){
        if(getSnackbar()!=null){
            TextView message = (TextView) getSnackbar().getView().findViewById(R.id.snackbar_text);
            //View.setTextAlignment需要SDK>=17
            message.setTextAlignment(View.TEXT_ALIGNMENT_GRAVITY);
            message.setGravity(Gravity.CENTER_VERTICAL|Gravity.RIGHT);
        }
    }
    return this;
}
 
源代码8 项目: ssj   文件: OptionTable.java
/**
 * @param activity   Activity
 * @param options    Option[]
 * @param owner Object
 * @return TableRow
 */
public static TableRow createTable(Activity activity, Option[] options, Object owner)
{
	TableRow tableRow = new TableRow(activity);
	tableRow.setLayoutParams(new TableLayout.LayoutParams(TableLayout.LayoutParams.MATCH_PARENT, TableLayout.LayoutParams.MATCH_PARENT));
	//
	LinearLayout linearLayout = new LinearLayout(activity);
	linearLayout.setOrientation(LinearLayout.VERTICAL);
	if (owner != null && (owner instanceof Transformer || owner instanceof Consumer))
	{
		//add divider
		linearLayout.addView(Util.addDivider(activity));
	}
	TextView textViewName = new TextView(activity);
	textViewName.setText(R.string.str_options);
	textViewName.setTextAlignment(View.TEXT_ALIGNMENT_VIEW_START);
	textViewName.setTextSize(TypedValue.COMPLEX_UNIT_SP, 22);
	linearLayout.addView(textViewName);
	//
	LinearLayout linearLayoutOptions = new LinearLayout(activity);
	linearLayoutOptions.setBackgroundColor(activity.getResources().getColor(R.color.colorListBorder));
	linearLayoutOptions.setOrientation(LinearLayout.VERTICAL);
	//options
	for (int i = 0; i < options.length; i++)
	{
		if (options[i].isAssignableByString())
		{
			linearLayoutOptions.addView(addOption(activity, options[i], owner));
		}
	}
	linearLayout.addView(linearLayoutOptions);
	tableRow.addView(linearLayout);
	return tableRow;
}
 
源代码9 项目: SnackbarUtils   文件: SnackbarUtils.java
/**
 * 设置TextView(@+id/snackbar_text)中文字的对齐方式 居中
 * @return
 */
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
public SnackbarUtils messageCenter(){
    if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1){
        if(getSnackbar()!=null){
            TextView message = (TextView) getSnackbar().getView().findViewById(R.id.snackbar_text);
            //View.setTextAlignment需要SDK>=17
            message.setTextAlignment(View.TEXT_ALIGNMENT_GRAVITY);
            message.setGravity(Gravity.CENTER);
        }
    }
    return this;
}
 
源代码10 项目: SnackbarUtils   文件: SnackbarUtils.java
/**
 * 设置TextView(@+id/snackbar_text)中文字的对齐方式 居右
 * @return
 */
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
public SnackbarUtils messageRight(){
    if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1){
        if(getSnackbar()!=null){
            TextView message = (TextView) getSnackbar().getView().findViewById(R.id.snackbar_text);
            //View.setTextAlignment需要SDK>=17
            message.setTextAlignment(View.TEXT_ALIGNMENT_GRAVITY);
            message.setGravity(Gravity.CENTER_VERTICAL|Gravity.RIGHT);
        }
    }
    return this;
}
 
源代码11 项目: CSnackBar   文件: Snackbar.java
private static void setTextAlignment(android.support.design.widget.Snackbar snackbar) {
    TextView textView = (TextView) snackbar.getView().findViewById(android.support.design.R.id.snackbar_text);

    LinearLayout.LayoutParams params = (LinearLayout.LayoutParams) textView.getLayoutParams();
    params.width = ViewGroup.LayoutParams.MATCH_PARENT;
    textView.setLayoutParams(params);

    switch (textAlign) {
        case CENTER:
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1)
                textView.setTextAlignment(View.TEXT_ALIGNMENT_CENTER);
            else
                textView.setGravity(Gravity.CENTER_HORIZONTAL);
            break;
        case RIGHT:
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1)
                textView.setTextAlignment(View.TEXT_ALIGNMENT_VIEW_END);
            else
                textView.setGravity(Gravity.RIGHT);
            break;
        case LEFT:
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1)
                textView.setTextAlignment(View.TEXT_ALIGNMENT_VIEW_START);
            else
                textView.setGravity(Gravity.LEFT);
            break;
        default:
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1)
                textView.setTextAlignment(View.TEXT_ALIGNMENT_VIEW_START);
            else
                textView.setGravity(Gravity.LEFT);
            break;
    }
}
 
源代码12 项目: SweetTips   文件: SnackbarUtils.java
/**
 * 设置TextView(@+id/snackbar_text)中文字的对齐方式 居中
 * @return
 */
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
public SnackbarUtils messageCenter(){
    if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1){
        if(getSnackbar()!=null){
            TextView message = (TextView) getSnackbar().getView().findViewById(R.id.snackbar_text);
            //View.setTextAlignment需要SDK>=17
            message.setTextAlignment(View.TEXT_ALIGNMENT_GRAVITY);
            message.setGravity(Gravity.CENTER);
        }
    }
    return this;
}
 
源代码13 项目: SweetTips   文件: SnackbarUtils.java
/**
 * 设置TextView(@+id/snackbar_text)中文字的对齐方式 居右
 * @return
 */
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
public SnackbarUtils messageRight(){
    if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1){
        if(getSnackbar()!=null){
            TextView message = (TextView) getSnackbar().getView().findViewById(R.id.snackbar_text);
            //View.setTextAlignment需要SDK>=17
            message.setTextAlignment(View.TEXT_ALIGNMENT_GRAVITY);
            message.setGravity(Gravity.CENTER_VERTICAL|Gravity.RIGHT);
        }
    }
    return this;
}
 
源代码14 项目: android_maplibui   文件: MatrixTableAdapter.java
private static void setPadding(Context context, TextView view) {
	int padding = ControlHelper.dpToPx(2, context.getResources());
	view.setPadding(padding, padding, padding, padding);
	view.setGravity(Gravity.CENTER_VERTICAL);
	if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
		view.setTextAlignment(View.TEXT_ALIGNMENT_CENTER);
	}
}
 
源代码15 项目: pandora   文件: GeneralDialog.java
private void transform(Window window) {
    try {
        View sysContent = window.findViewById(Window.ID_ANDROID_CONTENT);
        GradientDrawable backgroundDrawable = new GradientDrawable();
        backgroundDrawable.setCornerRadius(ViewKnife.dip2px(10));
        backgroundDrawable.setColor(Color.WHITE);
        ViewCompat.setBackground(sysContent, backgroundDrawable);

        DialogTitle title = window.findViewById(androidx.appcompat.R.id.alertTitle);
        TextView message = window.findViewById(android.R.id.message);
        Button button1 = window.findViewById(android.R.id.button1);
        Button button2 = window.findViewById(android.R.id.button2);
        Button button3 = window.findViewById(android.R.id.button3);
        LinearLayout buttonParent = (LinearLayout) button1.getParent();

        buttonParent.setShowDividers(LinearLayout.SHOW_DIVIDER_MIDDLE);
        GradientDrawable verticalDrawable = new GradientDrawable();
        verticalDrawable.setColor(0xffE5E5E5);
        verticalDrawable.setSize(ViewKnife.dip2px(.5f), 0);
        buttonParent.setDividerDrawable(verticalDrawable);
        buttonParent.setPadding(0, 0, 0, 0);

        GradientDrawable innerDrawable = new GradientDrawable();
        innerDrawable.setStroke(ViewKnife.dip2px(.5f), 0xffE5E5E5);
        InsetDrawable insetDrawable = new InsetDrawable(innerDrawable,
                ViewKnife.dip2px(-1), 0, ViewKnife.dip2px(-1), ViewKnife.dip2px(-1));
        ViewCompat.setBackground(buttonParent, insetDrawable);

        window.findViewById(androidx.appcompat.R.id.spacer).setVisibility(View.GONE);

        View textSpacerNoButtons = window.findViewById(androidx.appcompat.R.id.textSpacerNoButtons);
        if (textSpacerNoButtons != null) {
            textSpacerNoButtons.setVisibility(View.VISIBLE);
        }
        button1.setTextColor(0xff5B6B91);
        button2.setTextColor(0xff353535);
        button3.setTextColor(0xff353535);
        button1.setPaintFlags(Paint.FAKE_BOLD_TEXT_FLAG);
        button2.setPaintFlags(Paint.FAKE_BOLD_TEXT_FLAG);
        button3.setPaintFlags(Paint.FAKE_BOLD_TEXT_FLAG);
        ((LinearLayout.LayoutParams) button3.getLayoutParams()).weight = 1;
        ((LinearLayout.LayoutParams) button2.getLayoutParams()).weight = 1;
        ((LinearLayout.LayoutParams) button1.getLayoutParams()).weight = 1;

        if (message != null) {
            message.setTextColor(0xff202020);
            if (getArguments().getBoolean(ATTR7, false)) {
                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
                    message.setTextAlignment(View.TEXT_ALIGNMENT_CENTER);
                } else {
                    message.setGravity(Gravity.CENTER_HORIZONTAL);
                }
            }
        }

        title.setTextColor(0xff353535);
        title.setPaintFlags(Paint.FAKE_BOLD_TEXT_FLAG);
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
            title.setTextAlignment(View.TEXT_ALIGNMENT_CENTER);
        } else {
            title.setGravity(Gravity.CENTER_HORIZONTAL);
        }
    } catch (Throwable t) {
        t.printStackTrace();
    }
}
 
源代码16 项目: privacy-friendly-dame   文件: GameActivity.java
@Override
protected void onCreate(Bundle saved)
{
    super.onCreate(saved);

    mHandler = new Handler();

    game = loadFile();
    actionInProgress = false;
    setContentView(R.layout.activity_game);

    RelativeLayout content = findViewById((R.id.content_layout));

    if (saved == null) {
        if ((game==null || getIntent().getExtras()!=null)) {
            Bundle extras = getIntent().getExtras();
            GameType gameType = GameType.valueOf(extras.getString("gameType", GameType.Bot.name()));
            game = new CheckersGame(gameType,extras.getInt("level"));
        }
    }
    maxDepth=game.searchDepth;

    //  else game = saved.getParcelable("gameController");

    // generate new layout for the board
    checkersView = new CheckersLayout(game, this);
    checkersView.refresh();

    // layouts which contain all items displayed ingame
    LinearLayout mainContentLayout = findViewById(R.id.main_content);
    LinearLayout sideContentLayout = findViewById(R.id.side_content);

    mainContentLayout.addView(checkersView);

    // text which displays whose turn it is
    currentPlayerText = new TextView(this);
    currentPlayerText.setTextSize(24);
    currentPlayerText.setTextAlignment(View.TEXT_ALIGNMENT_CENTER);
    sideContentLayout.addView(currentPlayerText);

    // layouts for captured pieces
    capturedBlackPiecesUI = new LinearLayout(this);
    capturedBlackPiecesUI.setOrientation(LinearLayout.HORIZONTAL);

    capturedWhitePiecesUI = new LinearLayout(this);
    capturedWhitePiecesUI.setOrientation(LinearLayout.HORIZONTAL);

    sideContentLayout.addView(capturedBlackPiecesUI);
    sideContentLayout.addView(capturedWhitePiecesUI);



    SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
    sharedPreferences.registerOnSharedPreferenceChangeListener(preferencesChangeListener);

}
 
源代码17 项目: ssj   文件: ProviderTable.java
/**
 * @param activity   Activity
 * @param mainObject Object
 * @param dividerTop boolean
 * @return TableRow
 */
public static TableRow createStreamTable(Activity activity, final Object mainObject, boolean dividerTop, int heading)
{
    TableRow tableRow = new TableRow(activity);
    tableRow.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.MATCH_PARENT, TableRow.LayoutParams.MATCH_PARENT));
    LinearLayout linearLayout = new LinearLayout(activity);
    linearLayout.setOrientation(LinearLayout.VERTICAL);
    if (dividerTop)
    {
        //add divider
        linearLayout.addView(Util.addDivider(activity));
    }
    TextView textViewName = new TextView(activity);
    textViewName.setText(heading);
    textViewName.setTextAlignment(View.TEXT_ALIGNMENT_VIEW_START);
    textViewName.setTextSize(TypedValue.COMPLEX_UNIT_SP, 22);
    linearLayout.addView(textViewName);
    //get possible providers
    final Object[] objects = PipelineBuilder.getInstance().getPossibleStreamConnections(mainObject);
    //
    if (objects.length > 0) {
        for (int i = 0; i < objects.length; i++) {
            CheckBox checkBox = new CheckBox(activity);
            checkBox.setText(objects[i].getClass().getSimpleName());
            checkBox.setTextSize(TypedValue.COMPLEX_UNIT_SP, 19);
            Object[] providers = PipelineBuilder.getInstance().getStreamConnections(mainObject);
            if (providers != null) {
                for (Object provider : providers) {
                    if (objects[i].equals(provider)) {
                        checkBox.setChecked(true);
                        break;
                    }
                }
            }
            final int count = i;
            checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
                final Object o = objects[count];

                @Override
                public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                    if (isChecked) {
                        PipelineBuilder.getInstance().addStreamConnection(mainObject, (Provider) o);
                    } else {
                        PipelineBuilder.getInstance().removeStreamConnection(mainObject, (Provider) o);
                    }
                }
            });
            linearLayout.addView(checkBox);
        }
    } else
    {
        return null;
    }
    tableRow.addView(linearLayout);
    return tableRow;
}
 
源代码18 项目: ssj   文件: ProviderTable.java
/**
 * @param activity   Activity
 * @param mainObject Object
 * @param dividerTop boolean
 * @return TableRow
 */
public static TableRow createEventTable(Activity activity, final Object mainObject, boolean dividerTop)
{
    TableRow tableRow = new TableRow(activity);
    tableRow.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.MATCH_PARENT, TableRow.LayoutParams.MATCH_PARENT));
    LinearLayout linearLayout = new LinearLayout(activity);
    linearLayout.setOrientation(LinearLayout.VERTICAL);
    if (dividerTop)
    {
        //add divider
        linearLayout.addView(Util.addDivider(activity));
    }
    TextView textViewName = new TextView(activity);
    textViewName.setText(R.string.str_event_input);
    textViewName.setTextAlignment(View.TEXT_ALIGNMENT_VIEW_START);
    textViewName.setTextSize(TypedValue.COMPLEX_UNIT_SP, 22);
    linearLayout.addView(textViewName);
    //get possible providers
    final Object[] objects = PipelineBuilder.getInstance().getPossibleEventConnections(mainObject);
    //
    if (objects.length > 0) {
        for (int i = 0; i < objects.length; i++) {

            if(PipelineBuilder.getInstance().isManagedFeedback(objects[i]))
                continue;

            CheckBox checkBox = new CheckBox(activity);
            checkBox.setText(objects[i].getClass().getSimpleName());
            checkBox.setTextSize(TypedValue.COMPLEX_UNIT_SP, 19);
            Object[] providers = PipelineBuilder.getInstance().getEventConnections(mainObject);
            if (providers != null) {
                for (Object provider : providers) {
                    if (objects[i].equals(provider)) {
                        checkBox.setChecked(true);
                        break;
                    }
                }
            }
            final int count = i;
            checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
                final Object o = objects[count];

                @Override
                public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                    if (isChecked) {
                        PipelineBuilder.getInstance().addEventConnection(mainObject, (Component) o);
                    } else {
                        PipelineBuilder.getInstance().removeEventConnection(mainObject, (Component) o);
                    }
                }
            });
            linearLayout.addView(checkBox);
        }
    } else
    {
        return null;
    }
    tableRow.addView(linearLayout);
    return tableRow;
}
 
源代码19 项目: ssj   文件: ProviderTable.java
/**
 * @param activity   Activity
 * @param mainObject Object
 * @param dividerTop boolean
 * @return TableRow
 */
public static TableRow createModelTable(Activity activity, final Object mainObject, boolean dividerTop, int heading)
{
    TableRow tableRow = new TableRow(activity);
    tableRow.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.MATCH_PARENT, TableRow.LayoutParams.MATCH_PARENT));
    LinearLayout linearLayout = new LinearLayout(activity);
    linearLayout.setOrientation(LinearLayout.VERTICAL);
    if (dividerTop)
    {
        //add divider
        linearLayout.addView(Util.addDivider(activity));
    }
    TextView textViewName = new TextView(activity);
    textViewName.setText(heading);
    textViewName.setTextAlignment(View.TEXT_ALIGNMENT_VIEW_START);
    textViewName.setTextSize(TypedValue.COMPLEX_UNIT_SP, 22);
    linearLayout.addView(textViewName);

    //get possible providers
    final Object[] objects = (mainObject instanceof IModelHandler) ?
            PipelineBuilder.getInstance().getAll(PipelineBuilder.Type.Model) :
            PipelineBuilder.getInstance().getModelHandlers();

    if (objects.length > 0) {
        for (int i = 0; i < objects.length; i++) {
            CheckBox checkBox = new CheckBox(activity);
            checkBox.setText(objects[i].getClass().getSimpleName());
            checkBox.setTextSize(TypedValue.COMPLEX_UNIT_SP, 19);

            Object[] connections = PipelineBuilder.getInstance().getModelConnections(mainObject);
            if (connections != null) {
                for (Object conn : connections) {
                    if (objects[i].equals(conn)) {
                        checkBox.setChecked(true);
                        break;
                    }
                }
            }

            final int count = i;
            checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
                final Object o = objects[count];

                @Override
                public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                    if (isChecked) {
                        PipelineBuilder.getInstance().addModelConnection((Component) mainObject, (Component) o);
                    } else {
                        PipelineBuilder.getInstance().removeModelConnection((Component) mainObject, (Component) o);
                    }
                }
            });
            linearLayout.addView(checkBox);
        }
    } else
    {
        return null;
    }
    tableRow.addView(linearLayout);
    return tableRow;
}
 
 方法所在类
 同类方法