欧美一级特黄大片做受成人-亚洲成人一区二区电影-激情熟女一区二区三区-日韩专区欧美专区国产专区

重構(gòu)Refactor的小例子

package com.example.ex_templete;

站在用戶的角度思考問題,與客戶深入溝通,找到翠屏網(wǎng)站設(shè)計(jì)與翠屏網(wǎng)站推廣的解決方案,憑借多年的經(jīng)驗(yàn),讓設(shè)計(jì)與互聯(lián)網(wǎng)技術(shù)結(jié)合,創(chuàng)造個(gè)性化、用戶體驗(yàn)好的作品,建站類型包括:做網(wǎng)站、成都網(wǎng)站建設(shè)、企業(yè)官網(wǎng)、英文網(wǎng)站、手機(jī)端網(wǎng)站、網(wǎng)站推廣、國際域名空間、網(wǎng)站空間、企業(yè)郵箱。業(yè)務(wù)覆蓋翠屏地區(qū)。

import java.text.DecimalFormat;

import android.app.Activity;

import android.os.Bundle;

import android.view.View;

import android.view.View.OnClickListener;

import android.widget.Button;

import android.widget.EditText;

import android.widget.TextView;

import com.example.ex_templete.R;

public class Bmi extends Activity {

@Override

public void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_main);

initUI();

}

private void initUI() {

// Listen for button clicks

Button button = (Button) findViewById(R.id.submit);

button.setOnClickListener(calcBMI);

fieldheight = (EditText) findViewById(R.id.height);

fieldweight = (EditText) findViewById(R.id.weight);

result = (TextView) findViewById(R.id.result);

fieldsuggest = (TextView) findViewById(R.id.suggest);

}

private OnClickListener calcBMI = new OnClickListener() {

@Override

public void onClick(View v) {

DecimalFormat nf = new DecimalFormat("0.00");

double height = Double

.parseDouble(fieldheight.getText().toString()) / 100;

double weight = Double

.parseDouble(fieldweight.getText().toString());

double BMI = weight / (height * height);

result.setText("Your BMI is " + nf.format(BMI));

// Give health advice

if (BMI > 25) {

fieldsuggest.setText("太肥啦");

} else if (BMI < 20) {

fieldsuggest.setText("很骨感");

} else {

fieldsuggest.setText("身材不錯(cuò)");

}

}

};

private EditText fieldheight;

private EditText fieldweight;

private TextView result;

private TextView fieldsuggest;

}

xml中只需要兩個(gè)editText,兩個(gè)textview,一個(gè)按鈕即可

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"

    xmlns:tools="http://schemas.android.com/tools"

    android:layout_width="match_parent"

    android:layout_height="match_parent"

    android:paddingBottom="@dimen/activity_vertical_margin"

    android:paddingLeft="@dimen/activity_horizontal_margin"

    android:paddingRight="@dimen/activity_horizontal_margin"

    android:paddingTop="@dimen/activity_vertical_margin"

    tools:context="com.example.ex_templete.MainActivity" >

    <Button

        android:id="@+id/submit"

        android:layout_width="wrap_content"

        android:layout_height="wrap_content"

        android:layout_alignParentBottom="true"

        android:layout_centerHorizontal="true"

        android:layout_marginBottom="134dp"

        android:text="提交" />

    <EditText

        android:id="@+id/height"

        android:layout_width="wrap_content"

        android:layout_height="wrap_content"

        android:layout_alignParentLeft="true"

        android:layout_alignParentTop="true"

        android:ems="10" />

    <EditText

        android:id="@+id/weight"

        android:layout_width="wrap_content"

        android:layout_height="wrap_content"

        android:layout_alignLeft="@+id/height"

        android:layout_below="@+id/height"

        android:layout_marginTop="28dp"

        android:ems="10" >

        <requestFocus />

    </EditText>

    <TextView

        android:id="@+id/result"

        android:layout_width="wrap_content"

        android:layout_height="wrap_content"

        android:layout_alignLeft="@+id/weight"

        android:layout_below="@+id/weight"

        android:layout_marginTop="30dp"

        android:text="Large Text"

        android:textAppearance="?android:attr/textAppearanceLarge" />

    <TextView

        android:id="@+id/suggest"

        android:layout_width="wrap_content"

        android:layout_height="wrap_content"

        android:layout_alignLeft="@+id/result"

        android:layout_below="@+id/result"

        android:layout_marginTop="25dp"

        android:text="Large Text"

        android:textAppearance="?android:attr/textAppearanceLarge" />

</RelativeLayout>

新聞名稱:重構(gòu)Refactor的小例子
當(dāng)前路徑:http://aaarwkj.com/article14/ipdhde.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供品牌網(wǎng)站設(shè)計(jì)電子商務(wù)、面包屑導(dǎo)航、網(wǎng)站排名、網(wǎng)站建設(shè)云服務(wù)器

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

網(wǎng)站優(yōu)化排名
亚洲欧美综合伊人看片综合| 亚洲国产成人av精品精品国产自 | 欧美国产日韩在线一区二区三区| dy888午夜福利精品国产97| 色综合久久天天射天天干| 国产精品熟女亚洲av| 久久国产综合精品电影| 亚洲精品国产亚洲精品| 亚洲黄色艳情视频录像| 久久人妻久久人妻久久| 亚洲欧美日韩成人在线观看| 国产一边打电话一边操| 日韩高清亚洲一区二区| 亚洲一区二区三区久久精品| 欧美精品久久久久九九九| 国产精品超碰在线观看| 天天操操操操操操夜夜爽| 日进去了啊内射视频| 精品国产乱码久久蜜桃| 青青草成年人免费视频| 国产精品av国产精华液| 国产剧情av色诱女教师| 久久精品国产亚洲av清纯| 国产国产成人精品久久| 亚洲一区二区三区久久精品 | 日韩av在线观看大全| 免费人妻一区二区三区| 91香蕉国产在线观看| 久久免费少妇高潮99精品| 日韩一区二区三精品| 日韩av不卡免费播放| 亚洲巨人精品福利导航| 久久东京热日韩精品一区| 亚洲综合色日本日b网| 黑人巨大一区二区三区| 色91精品在线观看剧情| 日韩欧美一区二区麻豆| 欧美影院波波在线影院| 国产在线不卡免费精品| 黄片在线免费观看欧美中文| 91亚洲欧美日韩在线观看|