#负分小组WEEK1#一个开头&小组介绍

写在开头  

   在游戏开发领域,有一句激励人心的名言“开局一条狗,装备全靠打!”,在软件需求工程与建模的课程上,我们面临的情况也并不比“开局一条狗”强,开局-3分,因为考评时刻献上了一片白茫茫的博客!但是我们的-3分并不是说什么都没做,但没料到打分的重点在于博客!当然还有一句名言“好饭不怕晚”,我们依旧信心十足,如果说我们真是做不好,那得负分是活该,如果我们真有做好软件开发的本事,那我们会因为这个开局而激发出更多的动力!

   开局-3分,第一全靠拼!


 

小组成员简介

   组长:1120161949 刘镓煜

   组员:1120161945 雷云霖(技术总监!)

              1120161963 徐琳锴(技术担当!)

              1120161964 姚亚军(万金油1号)

              1320172222 李贵强(万金油2号)

              1120161968 赵梓清 (视觉总监&唯一的小公主!)


再次致歉

     老师,我们再也不拖了OTZ OTZ OTZ OTZ OTZ OTZ

 

转载于:https://www.cnblogs.com/bitsss/p/9120500.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
好的,对于您的需求,您可以按照以下步骤实现一个篮球记分牌的悬浮窗: 1. 创建一个Service类,用于显示悬浮窗。在该类中,您可以使用WindowManager类来添加悬浮窗,并设置悬浮窗的布局: ```java public class FloatingService extends Service { private WindowManager windowManager; private View floatView; private TextView team1TextView, team2TextView; private Button addOneButton, addTwoButton, addThreeButton, undoButton, resetButton; private int team1Score = 0, team2Score = 0; @Override public void onCreate() { super.onCreate(); windowManager = (WindowManager) getSystemService(WINDOW_SERVICE); LayoutInflater inflater = LayoutInflater.from(this); floatView = inflater.inflate(R.layout.floating_layout, null); // 设置悬浮窗的位置等属性 WindowManager.LayoutParams params = new WindowManager.LayoutParams( WindowManager.LayoutParams.WRAP_CONTENT, WindowManager.LayoutParams.WRAP_CONTENT, WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY, WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE, PixelFormat.TRANSLUCENT ); params.gravity = Gravity.START | Gravity.TOP; params.x = 0; params.y = 0; // 添加悬浮窗 windowManager.addView(floatView, params); // 初始化控件 team1TextView = floatView.findViewById(R.id.team1_text); team2TextView = floatView.findViewById(R.id.team2_text); addOneButton = floatView.findViewById(R.id.add_one_button); addTwoButton = floatView.findViewById(R.id.add_two_button); addThreeButton = floatView.findViewById(R.id.add_three_button); undoButton = floatView.findViewById(R.id.undo_button); resetButton = floatView.findViewById(R.id.reset_button); // 设置初始分数和点击事件 updateScores(); addOneButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { addScore(1); } }); addTwoButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { addScore(2); } }); addThreeButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { addScore(3); } }); undoButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { undoLastScore(); } }); resetButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { resetScores(); } }); } @Override public void onDestroy() { super.onDestroy(); if (floatView != null) { windowManager.removeView(floatView); } } @Nullable @Override public IBinder onBind(Intent intent) { return null; } private void updateScores() { team1TextView.setText(String.valueOf(team1Score)); team2TextView.setText(String.valueOf(team2Score)); } private void addScore(int score) { team1Score += score; updateScores(); } private void undoLastScore() { // 撤回上一步加分 // 注意需要处理减分后的负分情况 if (team1Score > 0) { team1Score--; } updateScores(); } private void resetScores() { team1Score = 0; team2Score = 0; updateScores(); } } ``` 2. 在res目录下创建一个floating_layout.xml文件,用于定义悬浮窗的布局。您可以在该布局中添加两个TextView来显示队伍名和比分,以及五个Button来实现加分、撤回和重置操作: ```xml <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical"> <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal"> <EditText android:id="@+id/team1_text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:hint="队伍1" /> <EditText android:id="@+id/team2_text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:hint="队伍2" /> </LinearLayout> <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal"> <Button android:id="@+id/add_one_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="+1" /> <Button android:id="@+id/add_two_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="+2" /> <Button android:id="@+id/add_three_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="+3" /> <Button android:id="@+id/undo_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="撤回" /> <Button android:id="@+id/reset_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="重置" /> </LinearLayout> </LinearLayout> ``` 3. 在AndroidManifest.xml文件中添加悬浮窗权限和声明FloatingService: ```xml <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" /> <application ... <service android:name=".FloatingService" android:enabled="true" android:exported="true" /> ... </application> ``` 这样,您就可以通过悬浮窗来实现篮球记分牌的功能了。在悬浮窗中,您可以编辑队伍名,点击按钮来加分、撤回和重置比分。 希望以上内容对您有所帮助!如果您有任何疑问,请随时提问。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值