首页 > 其他分享 >第二周星期五每日总结

第二周星期五每日总结

时间:2023-02-24 19:56:06浏览次数:36  
标签:总结 通过 程序 学习 星期五 第二周 计算器

       今天初步学习了如何通过Android Studio开发简单的程序,并通过在网上寻找代码,成功的修改并写出了一个计算器的小程序。但是通过本次的学习我只是简单掌握了如何通过android studio设计出简单程序的界面,至于程序后台的运算,判断存储仍毫无头绪,并且没有学会如何添加背景图片的操作,这些是我在往后的学习中必需掌握的东西,希望通过明天的学习我能够初步的掌握后台的操作,争取早日能够完成第一次各人作业程序的开发。

计算器程序运行和设计界面:

界面设计部分代码:

  1 <?xml version="1.0" encoding="utf-8"?>
  2 <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
  3     android:layout_width="fill_parent"
  4     android:layout_height="wrap_content"
  5     >
  6     <LinearLayout
  7         android:layout_width="fill_parent"
  8         android:layout_height="fill_parent"
  9         android:orientation="vertical" >
 10         <EditText
 11             android:id="@+id/input"
 12             android:layout_width="fill_parent"
 13             android:layout_height="wrap_content"
 14             android:layout_gravity="center"
 15             android:editable="false"
 16             android:hint="@string/shuru" />
 17 
 18         <EditText
 19             android:id="@+id/output"
 20             android:layout_width="fill_parent"
 21             android:layout_height="wrap_content"
 22             android:layout_gravity="center"
 23             android:editable="true"
 24             android:gravity="right"
 25             android:hint="@string/shuchu" />
 26 
 27         <RelativeLayout
 28             android:layout_width="fill_parent"
 29             android:layout_height="wrap_content" >
 30 
 31             <Button
 32                 android:id="@+id/seven"
 33                 android:layout_width="80dp"
 34                 android:layout_height="70dp"
 35                 android:layout_alignParentLeft="true"
 36                 android:text="@string/seven"
 37                 android:textSize="40sp" />
 38 
 39             <Button
 40                 android:id="@+id/eight"
 41                 android:layout_width="80dp"
 42                 android:layout_height="70dp"
 43                 android:layout_toRightOf="@id/seven"
 44                 android:text="@string/eight"
 45                 android:textSize="40sp" />
 46 
 47             <Button
 48                 android:id="@+id/nine"
 49                 android:layout_width="80dp"
 50                 android:layout_height="70dp"
 51                 android:layout_toRightOf="@id/eight"
 52                 android:text="@string/nine"
 53                 android:textSize="40sp" />
 54 
 55             <Button
 56                 android:id="@+id/add"
 57                 android:layout_width="80dp"
 58                 android:layout_height="70dp"
 59                 android:layout_alignParentRight="true"
 60                 android:layout_toRightOf="@id/nine"
 61                 android:text="@string/add"
 62                 android:textSize="40sp" />
 63 
 64             <Button
 65                 android:id="@+id/four"
 66                 android:layout_width="80dp"
 67                 android:layout_height="70dp"
 68                 android:layout_alignParentLeft="true"
 69                 android:layout_below="@id/seven"
 70                 android:text="@string/four"
 71                 android:textSize="40sp" />
 72 
 73             <Button
 74                 android:id="@+id/five"
 75                 android:layout_width="80dp"
 76                 android:layout_height="70dp"
 77                 android:layout_below="@id/eight"
 78                 android:layout_toRightOf="@id/four"
 79                 android:text="@string/five"
 80                 android:textSize="40sp" />
 81 
 82             <Button
 83                 android:id="@+id/six"
 84                 android:layout_width="80dp"
 85                 android:layout_height="70dp"
 86                 android:layout_below="@id/nine"
 87                 android:layout_toRightOf="@id/five"
 88                 android:text="@string/six"
 89                 android:textSize="40sp" />
 90 
 91             <Button
 92                 android:id="@+id/subtract"
 93                 android:layout_width="80dp"
 94                 android:layout_height="70dp"
 95                 android:layout_alignParentRight="true"
 96                 android:layout_below="@id/add"
 97                 android:layout_toRightOf="@id/six"
 98                 android:text="@string/subtract"
 99                 android:textSize="40sp" />
100 
101             <Button
102                 android:id="@+id/one"
103                 android:layout_width="80dp"
104                 android:layout_height="70dp"
105                 android:layout_alignParentLeft="true"
106                 android:layout_below="@id/four"
107                 android:text="@string/one"
108                 android:textSize="40sp" />
109 
110             <Button
111                 android:id="@+id/two"
112                 android:layout_width="80dp"
113                 android:layout_height="70dp"
114                 android:layout_below="@id/five"
115                 android:layout_toRightOf="@id/one"
116                 android:text="@string/two"
117                 android:textSize="40sp" />
118 
119             <Button
120                 android:id="@+id/three"
121                 android:layout_width="80dp"
122                 android:layout_height="70dp"
123                 android:layout_below="@id/six"
124                 android:layout_toRightOf="@id/two"
125                 android:text="@string/three"
126                 android:textSize="40sp" />
127 
128             <Button
129                 android:id="@+id/multiply"
130                 android:layout_width="80dp"
131                 android:layout_height="70dp"
132                 android:layout_alignParentRight="true"
133                 android:layout_below="@id/subtract"
134                 android:layout_toRightOf="@id/three"
135                 android:text="@string/multiply"
136                 android:textSize="40sp" />
137 
138             <Button
139                 android:id="@+id/zero"
140                 android:layout_width="80dp"
141                 android:layout_height="70dp"
142                 android:layout_alignParentLeft="true"
143                 android:layout_below="@id/one"
144                 android:text="@string/zero"
145                 android:textSize="40sp" />
146 
147             <Button
148                 android:id="@+id/clear"
149                 android:layout_width="80dp"
150                 android:layout_height="70dp"
151                 android:layout_below="@id/two"
152                 android:layout_toRightOf="@id/zero"
153                 android:text="@string/clear"
154                 android:textSize="40sp" />
155 
156             <Button
157                 android:id="@+id/result"
158                 android:layout_width="80dp"
159                 android:layout_height="70dp"
160                 android:layout_below="@id/three"
161                 android:layout_toRightOf="@id/clear"
162                 android:text="@string/result"
163                 android:textSize="40sp" />
164 
165             <Button
166                 android:id="@+id/divide"
167                 android:layout_width="80dp"
168                 android:layout_height="70dp"
169                 android:layout_alignParentRight="true"
170                 android:layout_below="@id/multiply"
171                 android:layout_toRightOf="@id/result"
172                 android:text="@string/divide"
173                 android:textSize="40sp" />
174 
175             <Button
176                 android:id="@+id/dot"
177                 android:layout_width="80dp"
178                 android:layout_height="70dp"
179                 android:layout_alignParentLeft="true"
180                 android:layout_below="@id/zero"
181                 android:text="@string/dot"
182                 android:textSize="40sp" />
183             <Button
184                 android:id="@+id/writeButton"
185                 android:layout_width="wrap_content"
186                 android:layout_height="wrap_content"
187                 android:layout_alignParentLeft="true"
188                 android:layout_below="@id/dot"
189                 android:text="@string/write"
190                 android:textSize="40sp" />
191             <Button
192                 android:id="@+id/readButton"
193                 android:layout_width="wrap_content"
194                 android:layout_height="wrap_content"
195                 android:layout_alignParentRight="true"
196                 android:layout_below="@id/dot"
197                 android:text="@string/read"
198                 android:textSize="40sp" />
199 
200             <CheckBox
201                 android:id="@+id/appendBox"
202                 android:text="@string/appendBox"
203                 android:layout_width="wrap_content"
204                 android:layout_height="wrap_content"
205                 android:layout_alignParentBottom="true"
206                 android:layout_toLeftOf="@+id/divide"
207                 android:layout_toStartOf="@+id/divide"
208                 android:layout_marginBottom="12dp"
209                 />
210 
211         </RelativeLayout>
212 
213         <EditText
214 
215             android:layout_width="match_parent"
216             android:layout_height="wrap_content"
217             android:id="@+id/textView" />
218 
219         <EditText
220 
221             android:layout_width="match_parent"
222             android:layout_height="wrap_content"
223             android:id="@+id/displayView" />
224 
225         <EditText
226             android:id="@+id/errorzero"
227             android:layout_width="fill_parent"
228             android:layout_height="wrap_content"
229             android:layout_gravity="center"
230             android:editable="false"
231             android:gravity="center"
232             />
233         <EditText
234             android:id="@+id/resultText"
235             android:layout_width="fill_parent"
236             android:layout_height="wrap_content"
237             android:layout_gravity="center"
238             android:editable="false"
239             android:gravity="left"
240             android:text="@string/resultText"
241             />
242     </LinearLayout>
243 </ScrollView>

 

标签:总结,通过,程序,学习,星期五,第二周,计算器
From: https://www.cnblogs.com/sgle0722/p/17152945.html

相关文章

  • 2023/2/24每日总结
    App项目有两个层次第一个层次是项目,另一个层次是模块>模块依附于项目,每个项目至少有一个模块,也能拥有多个模块>一般所言的“编译运行App”,指的是运行某个模块,而非运行某个......
  • 2.24每日总结5
    今天用了大约一个小时的时间学习了 相对布局RelativeLayout,并且对昨天学习的线性布局进行了复习如下图;然后学习了TextView其中的一部分Button但是由于教学视频中的And......
  • 2023.2.24总结
    今天课真多,我好累。上午五节课,下午四节课,晚上三节课。累死了,真的快累死了。高级英语课上课听听力,我差点睡着了。今天Javaweb真的啥也没学,真的啥也没学。因为没时间学。对......
  • 2月24日学习总结
    上午关于操作技巧ctrl+shift+tab左移标签栏;ctrl+tab右移标签栏错误码详细介绍《谈谈接口错误码》​​https://www.jianshu.com/p/d1fba0068b36​​我的理解:就如404、403这种......
  • 助教总结
    一、助教工作的具体职责和任务 (包括:你和老师是如何配合的、你和课程其他助教是如何配合的(如果有的话)) 我担任的是毕设助教,主要协助老师对毕业班的毕业设计所需材......
  • 2-24总结
    经过昨天的写代码,不是发现了一个无法运行的问题。发现是由于servlet的代码发生了错误,但是我和博主的环境并不相同,于是乎借鉴了同学们上学期的代码在网上搜索了一番之后,希......
  • 今日总结-springboot搭建
    SpringBoot环境搭建相信大家都对SpringBoot有了个基本的认识了,前面一直在说,SpringBoot多么多么优秀,但是你没有实际的搭建一个SpringBoot环境,你很难去体会SpringBoot......
  • typora快捷操作总结
    标题等级ctrl+1一级标题ctrl+2二级标题ctrl+3三级标题ctrl+4四级标题ctrl+5五级标题ctrl+0段落ctrl+=提高标题等级ctrl+-降低标题等级......
  • 2018年最全干货总结
    新手?大佬?今天本平台完整得来一次干货大全,你们都知道哪些呢?最全干货大全之前很多读者反映新人和旧人得分的明细一些,那今天先总结一下本平台自创办以来一些经典的干货和实验等......
  • typora快捷操作总结
    标题等级ctrl+1一级标题ctrl+2二级标题ctrl+3三级标题ctrl+4四级标题ctrl+5五级标题ctrl+0段落ctrl+=提高标题等级ctrl+-降低标题等级......