Java Code Examples for android.widget.TextView.setWidth()

The following are Jave code examples for showing how to use setWidth() of the android.widget.TextView class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: SearchLayout   File: FlowSearchLayout.java   View Source Code Vote up 6 votes
private void initHistoryData(List<String> allNames) {
    int padding = (int) (DensityUtil.dip2px(10f) * DensityUtil.getBaseScale(getContext()));
    TagAdapter adapter = new TagAdapter<String>(allNames) {
        @Override
        public View getView(FlowLayout parent, int position, String s) {
            TextView textView = new TextView(getContext());
            textView.setLayoutParams(new RadioGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));
            textView.setWidth((int) (DensityUtil.dip2px(80f) * DensityUtil.getBaseScale(getContext())));
            textView.setLines(1);
            textView.setGravity(Gravity.CENTER);
            textView.setEllipsize(TextUtils.TruncateAt.END);
            textView.setPadding(padding, padding, padding, padding);
            textView.setText(s);
            return textView;
        }
    };
    mBinding.flowLayoutHistory.setAdapter(adapter);
    mBinding.flowLayoutHistory.setOnTagClickListener((view, position, parent) -> {
        String item = (String) adapter.getItem(position);
        return false;
    });
}
 
Example 2
Project: AnimationWrapLayout   File: MainActivity.java   View Source Code Vote up 6 votes
private TextView inflateTextView() {
    GradientDrawable shape = new GradientDrawable();
    shape.setCornerRadius(8);
    shape.setColor(0xff000000 | mRandom.nextInt(0x00ffffff));
    TextView textView = new TextView(this);
    textView.setGravity(Gravity.CENTER);
    textView.setTextColor(Color.WHITE);
    textView.setWidth(150 + mRandom.nextInt(3) * 50);
    textView.setHeight(150 + mRandom.nextInt(3) * 50);
    textView.setTextSize(32);
    if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.JELLY_BEAN) {
        textView.setBackgroundDrawable(shape);
    } else {
        textView.setBackground(shape);
    }
    textView.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(final View view) {
            mList.removeViewWithAnimation(view);
        }
    });
    textView.setText(String.format(Locale.JAPAN, "%1$02d", mCounter++));
    return textView;
}
 
Example 3
Project: MovingGdufe-Android   File: ScheduleView.java   View Source Code Vote up 6 votes
private View addStartView(int startnum, final int week, final int start) {
        LinearLayout mStartView = new LinearLayout(getContext());
        mStartView.setOrientation(VERTICAL);
        for (int i = 1; i < startnum; i++) {
            TextView mTime = new TextView(getContext());
            mTime.setGravity(Gravity.CENTER);
            mTime.setHeight(dip2px(TimeTableHeight));
            mTime.setWidth(dip2px(TimeTableHeight));
            mStartView.addView(mTime);
            mStartView.addView(getWeekTransverseLine());

            //这里可以处理空白处点击添加课表
            final int finalI = i;
            mTime.setOnClickListener(new OnClickListener() {
                @Override
                public void onClick(View v) {
//                    Toast.makeText(getContext(), "星期" + week + "第" + (start + num) + "节", Toast.LENGTH_SHORT).show();
                    //TODO 添加课程
                    mClickListener.onClickScheduleAdd(week,start+ finalI);
                }
            });

        }
        return mStartView;
    }
 
Example 4
Project: PicShow-zhaipin   File: ClassifyAdapter.java   View Source Code Vote up 6 votes
@Override
public View getViewForTab(int position, View convertView, ViewGroup container) {
    if (convertView == null) {
        convertView =  LayoutInflater.from(container.getContext()).inflate(R.layout.tab_top, container, false);
    }
    TextView textView = (TextView) convertView;
    textView.setText(mClassifyList.get(position).getClassify_name());

    int witdh = getTextWidth(textView);
    int padding = DisplayUtil.dipToPix(container.getContext(), 8);
    //因为wrap的布局 字体大小变化会导致textView大小变化产生抖动,这里通过设置textView宽度就避免抖动现象
    //1.3f是根据上面字体大小变化的倍数1.3f设置
    textView.setWidth((int) (witdh * 1.3f) + padding);

    return convertView;
}
 
Example 5
Project: editor-sql   File: Utils.java   View Source Code Vote up 5 votes
public static Point MeasureString(Context context, String text, float fontSize, int widthMeasureSpec, int heightMeasureSpec) {
    int width = 0;
    int height = 0;

    if (null == context || null == text || text.isEmpty() || 0 == fontSize) {
        return null;
    }

    TextView tv = new TextView(context);

    tv.setText(text);// 待测文本
    tv.setTextSize(fontSize);// 字体

    if (ViewGroup.LayoutParams.WRAP_CONTENT != widthMeasureSpec && ViewGroup.LayoutParams.MATCH_PARENT != widthMeasureSpec) {
        tv.setWidth(widthMeasureSpec);// 如果设置了宽度,字符串的宽度则为所设置的宽度
    }

    if (ViewGroup.LayoutParams.WRAP_CONTENT != heightMeasureSpec && ViewGroup.LayoutParams.MATCH_PARENT != heightMeasureSpec) {
        tv.setHeight(heightMeasureSpec);
    }

    tv.setSingleLine(false);// 多行

    tv.measure(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.MATCH_PARENT);

    width = tv.getMeasuredWidth();
    height = tv.getMeasuredHeight();

    Point point = new Point();
    point.x = width;
    point.y = height;

    return point;
}
 
Example 6
Project: editor-sql   File: SqlViewTabRow.java   View Source Code Vote up 5 votes
public void setScale(float scale){

        if(this.scale != scale){
            this.scale = scale;
            int width;
            TextView textView;
            for (int i = 0;i < mTextViewList.size();i++){
                textView = mTextViewList.get(i);
                width = textView.getWidth();
                textView.setWidth((int) (width * (1 + scale)));
                widthList.set(i, (int) (width * (1 + scale)));
            }
        }
    }
 
Example 7
Project: open-rmbt   File: RMBTResultPagerAdapter.java   View Source Code Vote up 5 votes
public void addResultListItem(String title, String value, LinearLayout  netLayout) {
	final float scale = activity.getResources().getDisplayMetrics().density;
    final int leftRightItem = Helperfunctions.dpToPx(5, scale);
    final int topBottomItem = Helperfunctions.dpToPx(5, scale);
    final int leftRightDiv = Helperfunctions.dpToPx(0, scale);
    final int topBottomDiv = Helperfunctions.dpToPx(0, scale);
    final int heightDiv = Helperfunctions.dpToPx(1, scale);        
    final int topBottomImg = Helperfunctions.dpToPx(1, scale);
    
    final LinearLayout netItemLayout = new LinearLayout(activity); 
    
    netItemLayout.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT,
            LayoutParams.WRAP_CONTENT));
    netItemLayout.setPadding(leftRightItem, topBottomItem, leftRightItem, topBottomItem);
    
    netItemLayout.setGravity(Gravity.CENTER_VERTICAL);
    
    final TextView itemTitle = new TextView(activity, null, R.style.listResultItemTitle);
    itemTitle.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT,
            LayoutParams.WRAP_CONTENT, 0.4f));
    itemTitle.setWidth(0);
    itemTitle.setGravity(Gravity.LEFT);
    itemTitle.setText(title);
    
    netItemLayout.addView(itemTitle);
    
    final ImageView itemClassification = new ImageView(activity);
    itemClassification.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT,
            LayoutParams.MATCH_PARENT, 0.1f));
    itemClassification.setPadding(0, topBottomImg, 0, topBottomImg);
    
    itemClassification.setImageDrawable(activity.getResources().getDrawable(
            R.drawable.traffic_lights_none));
    netItemLayout.addView(itemClassification);
    
    final TextView itemValue = new TextView(activity, null, R.style.listResultItemValue);
    itemValue.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT,
            LayoutParams.WRAP_CONTENT, 0.5f));
    itemValue.setWidth(0);
    itemValue.setGravity(Gravity.LEFT);
    itemValue.setText(value);
    
    netItemLayout.addView(itemValue);
    
    netLayout.addView(netItemLayout);
    
    final View divider = new View(activity);
    divider.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, heightDiv,
            1));
    divider.setPadding(leftRightDiv, topBottomDiv, leftRightDiv, topBottomDiv);
    
    divider.setBackgroundResource(R.drawable.bg_trans_light_10);
    
    netLayout.addView(divider);
    
    netLayout.invalidate();
}
 
Example 8
Project: MovingGdufe-Android   File: ScheduleView.java   View Source Code Vote up 5 votes
/**
 * 横的分界线
 *
 * @return
 */
private View getWeekTransverseLine() {
    TextView mWeekline = new TextView(getContext());
    mWeekline.setBackgroundColor(getResources().getColor(R.color.view_line));
    mWeekline.setHeight(TimeTableLineHeight);
    mWeekline.setWidth(LayoutParams.FILL_PARENT);
    return mWeekline;
}
 
Example 9
Project: MovingGdufe-Android   File: ScheduleView.java   View Source Code Vote up 5 votes
/**
 * 竖向分界线
 *
 * @return
 */
private View getWeekVerticalLine() {
    TextView mWeekline = new TextView(getContext());
    mWeekline.setBackgroundColor(getResources().getColor(R.color.view_line));
    mWeekline.setHeight(dip2px(TimeTableWeekNameHeight));
    mWeekline.setWidth((TimeTableLineHeight));
    return mWeekline;
}
 
Example 10
Project: MovingGdufe-Android   File: ScheduleView.java   View Source Code Vote up 5 votes
/**
     * 获取单个课表View
     *
     * @param model 数据类型
     * @return
     */
    @SuppressWarnings("deprecation")
    private View getMode(final Schedule model) {
        LinearLayout mScheduleView = new LinearLayout(getContext());
        mScheduleView.setOrientation(VERTICAL);
        TextView mTimeTableNameView = new TextView(getContext());
        int num = model.getEndSec() - model.getStartSec();
        mTimeTableNameView.setHeight(dip2px((num + 1) * TimeTableHeight) + num * 2);
        mTimeTableNameView.setTextColor(getContext().getResources().getColor(
                android.R.color.white));
        mTimeTableNameView.setWidth(dip2px(50));
        mTimeTableNameView.setTextSize(CourseTextSize);
        mTimeTableNameView.setGravity(Gravity.CENTER);
        mTimeTableNameView.setText(model.getName() + "\n" + model.getLocation());
        mScheduleView.addView(mTimeTableNameView);
        mScheduleView.addView(getWeekTransverseLine());
        mScheduleView.setBackgroundDrawable(getContext().getResources()
                .getDrawable(colors[getColorNum(model.getName())]));

        if(mCurrentWeek != FileUtils.SP_WEEK_NOT_SET && !CalcUtils.isCurrentWeek(model.getPeriod(), mCurrentWeek)){
            mScheduleView.setBackgroundDrawable(getContext().getResources()
                    .getDrawable(notGocolors));
//            mTimeTableNameView.setTextColor(getContext().getResources().getColor(
//                    android.R.color.darker_gray));
        }

        mScheduleView.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
//                Toast.makeText(getContext(), model.getName() + "\n" + model.getLocation()+"\n" +model.getPeriod()+"\n"+ model.getTeacher(), Toast.LENGTH_SHORT).show();
                //TODO 编辑课程
                mClickListener.onClickScheduleEdit(model);
            }
        });
        return mScheduleView;
    }
 
Example 11
Project: TitanCompanion   File: SSAdventureMapFragment.java   View Source Code Vote up 5 votes
public void setClearingLayoutSizes(View rootView, Context context) {

        DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();
        float dpHeight = displayMetrics.heightPixels / displayMetrics.density;
        float dpWidth = displayMetrics.widthPixels / displayMetrics.density;

        dpHeight -= addClearingButton.getHeight();

        dpHeight /= 9;
        dpWidth /= 7;


        int finalValue = (int) Math.min(dpHeight, dpWidth);

        TableLayout table = rootView.findViewById(R.id.clearingGrid);
        final int childcount = table.getChildCount();
        for (int i = 0; i < childcount; i++) {
            TableRow row = (TableRow) table.getChildAt(i);

            final int cellCount = row.getChildCount();
            for (int j = 0; j < cellCount; j++) {
                TextView cell = (TextView) row.getChildAt(j);
                cell.setHeight(finalValue);
                cell.setWidth(finalValue);
            }


        }
    }
 
Example 12
Project: editor-sql   File: SqlCreateViewAdapter.java   View Source Code Vote up 4 votes
@Override
public void onBindViewHolder(MyHolder holder, int position) {
    holder.tableLayout.removeAllViews();
    holder.tableLayout.setTag(position);
    holder.tableRow.removeAllViews();
    NewColumnField newColumnField = mDates.get(position);
    TextView textView = null;

    for (int i = 0;i<mTitles.length;i++){
        switch (i){
            case 0:
                textView = new CustomImage(mContext,false,null);
                textView.setText(newColumnField.getFieldName());
                break;
            case 1:
                textView = new CustomImage(mContext,false,null);
                textView.setText(newColumnField.getFieldType());
                break;
            case 2:
                textView = new CustomImage(mContext,newColumnField.isCheck(),null);
                break;
            case 3:
                textView = new CustomImage(mContext,newColumnField.isNotNull(),null);
                break;
            case 4:
                textView = new CustomImage(mContext,newColumnField.isUnique(),null);
                break;
            case 5:
                textView = new CustomImage(mContext,newColumnField.isDefaultKey(),null);
                break;
            case 6:
                textView = new CustomImage(mContext,newColumnField.isForeignKey(),null);
                break;
            case 7:
                textView = new CustomImage(mContext,false,null);
                textView.setText(newColumnField.getDefaultValue());
                break;
            case 8:
                textView = new CustomImage(mContext,newColumnField.isPrimaryKey(),null);
                break;
            case 9:
                textView = new CustomImage(mContext,newColumnField.isAutoIncrement(),null);
                break;
            case 10:
                textView = new CustomImage(mContext,false,null);
                textView.setText(newColumnField.getFkTable());
                break;
            case 11:
                textView = new CustomImage(mContext,false,null);
                textView.setText(newColumnField.getFkField());
                break;
        }
        textView.setGravity(Gravity.CENTER_VERTICAL);
        textView.setSingleLine(true);
        textView.setTextColor(mContext.getResources().getColor(R.color.table_text_color));
        if( (i>0 && i<= 5) || i>9){
            textView.setWidth(FeViewUtils.dpToPx(85));
        }else {
            textView.setWidth(FeViewUtils.dpToPx(120));
        }
        textView.setPadding(25, 10, 25, 10);
        holder.tableRow.addView(textView);
    }

    if (position == mClickPosition) {
        holder.tableLayout.setBackgroundColor(mContext.getResources().getColor(R.color.blue));
    } else {
        holder.tableLayout.setBackgroundColor(mContext.getResources().getColor(android.R.color.transparent));
    }

    ViewGroup viewGroup = (ViewGroup) holder.tableRow.getParent();
    if (viewGroup != null) {
        viewGroup.removeAllViews();
    }
    holder.tableLayout.addView(holder.tableRow);
}
 
Example 13
Project: SmartChart   File: PanelListAdapter.java   View Source Code Vote up 4 votes
/**
 * 初始化横向表头的布局,必须在所有的布局都载入完之后才能调用
 * <p>
 * must be called in pl_root.post();
 */
private void initRowLayout() {

    if (rowDataList == null) {
        Log.e("PanelList", "custom Row data list is strongly recommended! Call setRowDataList(List<String> rowDataList) in your panel adapter");
    }
    int rowCount = ll_contentItem.getChildCount();

    List<String> rowDataList1 = getRowDataList(rowCount);

    //分隔线的设置,如果content的item设置了分割线,那row使用相同的分割线,除非单独给row设置了分割线
    ll_row.setBackgroundColor(Color.parseColor(rowColor));
    if (rowDivider == null) {
        ll_row.setDividerDrawable(ll_contentItem.getDividerDrawable());
    } else {
        ll_row.setDividerDrawable(rowDivider);
    }

    // 获得row一共有多少个item,然后使用循环往里面添加对应个数个TextView(简单粗暴)
    for (int i = 0; i < rowCount; i++) {
        View contentItem = ll_contentItem.getChildAt(i);// 获得item的item,以便获取宽度
        TextView rowItem = new TextView(context);
        rowItem.setText(rowDataList1.get(i));//设置文字
        Paint rowPaint=rowItem.getPaint();
        rowPaint.setFakeBoldText(false);
        rowPaint.setColor(context.getResources().getColor(R.color.color_646464));
        rowPaint.setTextSize(CommonUtils.dp2px(context,15));
        rowItem.setWidth(contentItem.getWidth()-2);//设置宽度
        rowItem.setHeight(titleHeight);//设置高度
        rowItem.setGravity(Gravity.CENTER);
        TextView line=new TextView(context);
        ll_row.addView(rowItem);
        if (i<rowCount-1){
            line.setBackgroundColor(Color.WHITE);
            line.setWidth(2);
            line.setHeight(titleHeight);
            ll_row.addView(line);
        }


    }
}
 
Example 14
Project: SmartChart   File: MyPanelListAdapter.java   View Source Code Vote up 4 votes
@NonNull
@Override
public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) {
    final Map<String, String> data = contentList.get(position);
    ViewHolder viewHolder;
    if (convertView == null) {
        viewHolder=new ViewHolder();
        convertView = LayoutInflater.from(parent.getContext()).inflate(resourceId, parent, false);
        viewHolder.linearLayout = (LinearLayout) convertView.findViewById(R.id.linear_root);
        int textWeight=CommonUtils.dp2px(context,itemHeight);
        for (int i=0;i<data.size();i++){
            TextView item = new TextView(context);
            item.setWidth(textWeight);//设置宽度
            item.setSingleLine();
            item.setGravity(Gravity.CENTER);
            item.setTextSize(15);
            item.setTextColor(context.getResources().getColor(R.color.color_323232));
            item.setPadding(5,5,5,5);
            viewHolder.linearLayout.addView(item);
        }
        convertView.setTag(viewHolder);

    }else{
        viewHolder= (ViewHolder) convertView.getTag();
    }
    for (int i=0;i<data.size();i++){
        ((TextView)viewHolder.linearLayout.getChildAt(i)).setText(data.get(i+1+""));
    }

    if (lv_content.isItemChecked(position)){
        convertView.setBackgroundColor(context.getResources().getColor(R.color.color_FBE382));
    } else {
        convertView.setBackgroundColor(context.getResources().getColor(R.color.white));
    }
    if (position%2==0){
        convertView.setBackgroundColor(context.getResources().getColor(R.color.color_f6f6f6));
    }else{
        convertView.setBackgroundColor(Color.WHITE);
    }
    return convertView;
}
 
Example 15
Project: Matrix-Calculator-for-Android   File: ViewMatrixFragment.java   View Source Code Vote up 4 votes
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    int index = getArguments().getInt("INDEX");

    View v = inflater.inflate(R.layout.view_matrix_frag, container, false);
    CardView cardView = (CardView) v.findViewById(R.id.DynamicCardView);

    SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getContext());
    String string = sharedPreferences.getString("ELEVATE_AMOUNT", "4");
    String string2 = sharedPreferences.getString("CARD_CHANGE_KEY", "#bdbdbd");

    cardView.setCardElevation(Integer.parseInt(string));
    cardView.setCardBackgroundColor(Color.parseColor(string2));

    CardView.LayoutParams params1 = new CardView.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,
            ViewGroup.LayoutParams.WRAP_CONTENT);

    GridLayout gridLayout = new GridLayout(getContext());
    gridLayout.setRowCount(((GlobalValues) getActivity().getApplication()).GetCompleteList().get(index).GetRow());
    gridLayout.setColumnCount(((GlobalValues) getActivity().getApplication()).GetCompleteList().get(index).GetCol());
    for (int i = 0; i < ((GlobalValues) getActivity().getApplication()).GetCompleteList().get(index).GetRow(); i++) {
        for (int j = 0; j < ((GlobalValues) getActivity().getApplication()).GetCompleteList().get(index).GetCol(); j++) {
            TextView textView = new TextView(getContext());
            textView.setGravity(Gravity.CENTER);
            textView.setText(SafeSubString(GetText(((GlobalValues) getActivity().getApplication()).GetCompleteList().get(index).GetElementof(i, j)), getLength()));
            textView.setWidth(CalculatedWidth(((GlobalValues) getActivity().getApplication()).GetCompleteList().get(index).GetCol()));
            textView.setTextSize(SizeReturner(((GlobalValues) getActivity().getApplication()).GetCompleteList().get(index).GetRow(), ((GlobalValues) getActivity().getApplication()).GetCompleteList().get(index).GetCol(),
                    PreferenceManager.getDefaultSharedPreferences(getContext()).
                            getBoolean("EXTRA_SMALL_FONT", false)));
            textView.setHeight(CalculatedHeight(((GlobalValues) getActivity().getApplication()).GetCompleteList().get(index).GetRow()));
            GridLayout.Spec Row = GridLayout.spec(i, 1);
            GridLayout.Spec Col = GridLayout.spec(j, 1);
            GridLayout.LayoutParams params = new GridLayout.LayoutParams(Row, Col);
            gridLayout.addView(textView, params);
        }
    }
    gridLayout.setLayoutParams(params1);
    cardView.addView(gridLayout);


    // Inflate the layout for this fragment
    return v;
}
 
Example 16
Project: Matrix-Calculator-for-Android   File: MinorChooserFragment.java   View Source Code Vote up 4 votes
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    final int index = getArguments().getInt("INDEX");

    View v = inflater.inflate(R.layout.view_matrix_frag, container, false);
    CardView cardView = (CardView) v.findViewById(R.id.DynamicCardView);

    SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getContext());
    String string = sharedPreferences.getString("ELEVATE_AMOUNT", "4");
    String string2 = sharedPreferences.getString("CARD_CHANGE_KEY", "#bdbdbd");

    cardView.setCardElevation(Integer.parseInt(string));
    cardView.setCardBackgroundColor(Color.parseColor(string2));

    CardView.LayoutParams params1 = new CardView.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,
            ViewGroup.LayoutParams.WRAP_CONTENT);

    GridLayout gridLayout = new GridLayout(getContext());
    gridLayout.setRowCount(((GlobalValues) getActivity().getApplication()).GetCompleteList().get(index).GetRow());
    gridLayout.setColumnCount(((GlobalValues) getActivity().getApplication()).GetCompleteList().get(index).GetCol());
    for (int i = 0; i < ((GlobalValues) getActivity().getApplication()).GetCompleteList().get(index).GetRow(); i++) {
        for (int j = 0; j < ((GlobalValues) getActivity().getApplication()).GetCompleteList().get(index).GetCol(); j++) {
            final TextView textView = new TextView(getContext());
            textView.setGravity(Gravity.CENTER);
            textView.setTag(i * 10 + j);
            textView.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    textView.setTypeface(textView.getTypeface(), Typeface.BOLD);
                    final ProgressDialog progressDialog = new ProgressDialog(getContext());
                    progressDialog.setIndeterminate(false);
                    progressDialog.setMessage(getString(R.string.Calculating));
                    progressDialog.setProgress(ProgressDialog.STYLE_SPINNER);
                    progressDialog.setTitle(getString(R.string.Calculating));
                    progressDialog.show();
                    Runnable runnable = new Runnable() {
                        @Override
                        public void run() {
                            float res = ((GlobalValues) getActivity().getApplication()).GetCompleteList().get(index).GetMinorDeterminant(((int) textView.getTag()) / 10, ((int) textView.getTag()) % 10);
                            Message message = new Message();
                            Bundle bundle = new Bundle();
                            bundle.putInt("REX", ((int) textView.getTag()) / 10);
                            bundle.putInt("REY", ((int) textView.getTag()) % 10);
                            bundle.putFloat("VALUE", res);
                            message.setData(bundle);
                            progressDialog.dismiss();
                            handler.sendMessage(message);
                        }
                    };
                    Thread thread = new Thread(runnable);
                    thread.start();
                }
            });
            textView.setText(SafeSubString(GetText(((GlobalValues) getActivity().getApplication()).GetCompleteList().get(index).GetElementof(i, j)), getLenght()));
            textView.setWidth(CalculatedWidth(((GlobalValues) getActivity().getApplication()).GetCompleteList().get(index).GetCol()));
            textView.setTextSize(SizeReturner(((GlobalValues) getActivity().getApplication()).GetCompleteList().get(index).GetRow(), ((GlobalValues) getActivity().getApplication()).GetCompleteList().get(index).GetCol(),
                    PreferenceManager.getDefaultSharedPreferences(getContext()).
                            getBoolean("EXTRA_SMALL_FONT", false)));
            textView.setHeight(CalculatedHeight(((GlobalValues) getActivity().getApplication()).GetCompleteList().get(index).GetRow()));
            GridLayout.Spec Row = GridLayout.spec(i, 1);
            GridLayout.Spec Col = GridLayout.spec(j, 1);
            GridLayout.LayoutParams params = new GridLayout.LayoutParams(Row, Col);
            gridLayout.addView(textView, params);
        }
    }
    gridLayout.setLayoutParams(params1);
    cardView.addView(gridLayout);

    // Inflate the layout for this fragment
    return v;

}