学习记录(3.22)
学习时长:6h
代码行数:约200行
今天上午继续学习网络传输的相应知识,之后学习毛概,为考研课打下了相应的基础。
下午制作了安卓的基础页面,并且跟同伴进行了页面布置的构思。
晚上跟乐队成员一起进行编曲,把《way back home》进行了放克化简单改编,到时候在音乐节上演出。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | <?xml version= "1.0" encoding= "utf-8" ?> <LinearLayout xmlns:android= "http://schemas.android.com/apk/res/android" android:layout_width= "match_parent" android:layout_height= "wrap_content" android:layout_gravity= "center" android:orientation= "vertical" > <LinearLayout android:layout_width= "wrap_content" android:layout_height= "wrap_content" android:layout_gravity= "center" android:orientation= "vertical" > <Button android:id= "@+id/btn_line" android:layout_width= "match_parent" android:layout_height= "wrap_content" android:text= "查询地铁线路" /> <Button android:id= "@+id/btn_station" android:layout_width= "match_parent" android:layout_height= "wrap_content" android:text= "查询地铁站" /> <Button android:id= "@+id/btn_chaxun" android:layout_width= "match_parent" android:layout_height= "wrap_content" android:text= "查询地铁路径" /> </LinearLayout> </LinearLayout> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | package com.example.subway; import android.content.Intent; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; public class Menu extends AppCompatActivity implements View.OnClickListener { private Button line1; private Button line2; private Button line3; @Override protected void onCreate(Bundle savedInstanceState) { super .onCreate(savedInstanceState); setContentView(R.layout.activity_menu); line1 = findViewById(R.id.btn_line); line1.setOnClickListener( this ); line2 = findViewById(R.id.btn_station); line2.setOnClickListener( this ); line3 = findViewById(R.id.btn_chaxun); line3.setOnClickListener( this ); } @Override public void onClick(View view) { Intent intent = new Intent(); switch (view.getId()){ case R.id.btn_line: intent.setClass(Menu. this , Line. class ); startActivity(intent); break ; case R.id.btn_station: intent.setClass(Menu. this , Station. class ); startActivity(intent); break ; case R.id.btn_chaxun: intent.setClass(Menu. this , StartEnd. class ); startActivity(intent); break ; } } } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | <?xml version= "1.0" encoding= "utf-8" ?> <LinearLayout xmlns:android= "http://schemas.android.com/apk/res/android" android:layout_width= "match_parent" android:layout_height= "match_parent" android:orientation= "vertical" android:gravity= "center" > <TextView android:layout_width= "wrap_content" android:layout_height= "wrap_content" android:text= "欢迎使用地铁查询系统" android:textSize= "40dp" /> <Button android:id= "@+id/btn_kaishi" android:layout_width= "wrap_content" android:layout_height= "wrap_content" android:text= "进入系统" android:background= "@color/teal_200" /> </LinearLayout> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | package com.example.subway; import android.content.Intent; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; public class MainActivity extends AppCompatActivity implements View.OnClickListener { @Override protected void onCreate(Bundle savedInstanceState) { super .onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button button = findViewById(R.id.btn_kaishi); button.setOnClickListener( this ); } @Override public void onClick(View view) { Intent intent = new Intent(); intent.setClass(MainActivity. this ,Menu. class ); startActivity(intent); } } |
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义