Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update to sdk33 and android 8.8.1 #3

Open
wants to merge 63 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
8400ef1
run at version 8.1.1 successfully
BriAlpha Nov 15, 2023
e48ffd9
update
BriAlpha Nov 17, 2023
5a07f0e
Update AlterTodayActivity.java
XiLin20 Nov 29, 2023
a8c30aa
Update NoteActivity.java
XiLin20 Nov 29, 2023
1034d12
Update TodayCreateActivitty.java
XiLin20 Nov 29, 2023
e7d0fa6
Merge pull request #1 from XiLin20/master
BriAlpha Nov 29, 2023
6e31df4
Log updated
Float-E Nov 30, 2023
707fd33
Merge pull request #2 from Float-E/master
BriAlpha Nov 30, 2023
2ace5ba
Merge pull request #2 from Float-E/master
BriAlpha Nov 30, 2023
96168ea
Merge remote-tracking branch 'origin/master'
HSQ7777 Dec 1, 2023
09736af
Merge pull request #3 from HSQ7777/master
BriAlpha Dec 1, 2023
765619a
history update
BriAlpha Dec 1, 2023
2d395dc
update main
BriAlpha Dec 1, 2023
6fa5179
Update TodayCreateActivitty.java
XiLin20 Dec 2, 2023
07ab6e9
Update TodayAdapter.java
XiLin20 Dec 2, 2023
2bab036
Update TodayAdapter.java
XiLin20 Dec 2, 2023
c3df7a1
Update SendMessage.java
XiLin20 Dec 2, 2023
beac564
Update activity_alter_today.xml
XiLin20 Dec 2, 2023
d45a281
Update activity_note.xml
XiLin20 Dec 2, 2023
9b9297e
Update activity_today_create_activitty.xml
XiLin20 Dec 2, 2023
6521a76
update sdk33 and androidx
BriAlpha Dec 3, 2023
de0c5e2
Merge pull request #4 from XiLin20/master
BriAlpha Dec 4, 2023
58ab47c
merge record!
BriAlpha Dec 4, 2023
17c2876
Merge branch 'master' of https://github.com/BriAlpha/Schedule
BriAlpha Dec 4, 2023
d1eb67b
udpate SendMessage bug
BriAlpha Dec 4, 2023
fc86568
!!!test tomato(setting替代tomato,误用)
BriAlpha Dec 10, 2023
deb1e84
tomato0.1 update
BriAlpha Dec 11, 2023
7ce882d
update tomato0.2 allFunction doable
BriAlpha Dec 11, 2023
1db5bad
update tomato0.3(ring, vibarate, notice)
BriAlpha Dec 11, 2023
78ba03e
update MainActivity with tomato button
BriAlpha Dec 11, 2023
16e6e66
Update AlterTodayActivity.java
XiLin20 Dec 12, 2023
f7b9bb0
Update TodayCreateActivitty.java
XiLin20 Dec 12, 2023
390c9fd
Update Plan.java
XiLin20 Dec 12, 2023
1c45c91
Update TodayAdapter.java
XiLin20 Dec 12, 2023
263e2d8
Update today_item.xml
XiLin20 Dec 12, 2023
ae8c581
Update activity_alter_today.xml
XiLin20 Dec 12, 2023
f5eebb3
Update strings.xml
XiLin20 Dec 12, 2023
8e326c7
Update activity_today_create_activitty.xml
XiLin20 Dec 12, 2023
6135d13
Merge pull request #5 from XiLin20/patch-6
BriAlpha Dec 12, 2023
a9d1e63
Merge pull request #6 from XiLin20/patch-8
BriAlpha Dec 12, 2023
5cccff2
Merge pull request #7 from XiLin20/patch-4
BriAlpha Dec 12, 2023
521b13a
Merge pull request #8 from XiLin20/patch-7
BriAlpha Dec 12, 2023
7f6193b
Merge pull request #9 from XiLin20/patch-2
BriAlpha Dec 12, 2023
ff05370
Merge pull request #10 from XiLin20/patch-1
BriAlpha Dec 12, 2023
32e06dd
Merge pull request #11 from XiLin20/patch-3
BriAlpha Dec 12, 2023
cb7f748
Merge pull request #12 from XiLin20/patch-5
BriAlpha Dec 12, 2023
8651d74
Revert "Merge pull request #11 from XiLin20/patch-3"
BriAlpha Dec 12, 2023
aa4f697
Revert "Update AlterTodayActivity.java"
BriAlpha Dec 12, 2023
8f9511a
Revert "Merge pull request #9 from XiLin20/patch-2"
BriAlpha Dec 12, 2023
fb87a10
Revert "Merge pull request #8 from XiLin20/patch-7"
BriAlpha Dec 12, 2023
3ee32ab
Revert "Merge pull request #7 from XiLin20/patch-4"
BriAlpha Dec 12, 2023
11f5def
Revert "Merge pull request #6 from XiLin20/patch-8"
BriAlpha Dec 12, 2023
dbb41c3
Revert "Merge pull request #5 from XiLin20/patch-6"
BriAlpha Dec 12, 2023
02aaa13
update tomato0.4
BriAlpha Dec 12, 2023
486236e
update tomato0.5(icon
BriAlpha Dec 12, 2023
7506fa9
update record(icon
BriAlpha Dec 12, 2023
b2c257b
update activity_start
BriAlpha Dec 12, 2023
1d5da94
update setting/help
BriAlpha Dec 12, 2023
d6a8d01
update set english
BriAlpha Dec 12, 2023
9d1dde1
redo activity_main
BriAlpha Dec 12, 2023
497e66e
update
BriAlpha Dec 12, 2023
abec62f
update history
BriAlpha Dec 12, 2023
6a5e4c3
update finally
BriAlpha Dec 12, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update tomato0.2 allFunction doable
  • Loading branch information
BriAlpha committed Dec 11, 2023
commit 7ce882d0a4c9ea8a88870673124b1c9fc439f2cc
Original file line number Diff line number Diff line change
@@ -5,26 +5,46 @@
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast;

import androidx.appcompat.app.AppCompatActivity;

import com.example.yzbkaka.things.R;
import com.example.yzbkaka.things.Record.RecordActivity;
import com.example.yzbkaka.things.db.UserRecord;

import java.util.Calendar;
import java.util.TimeZone;

public class TomatoActivity extends AppCompatActivity {

public class TomatoActivity extends AppCompatActivity {
private Button back;
private TextView timerTextView;
private Button startButton;
private CountDownTimer countDownTimer;
private EditText action;
private EditText editTextTime;
private Spinner categories;
private boolean isTimerRunning = false;
private Calendar calendar;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_tomato);

back = (Button)findViewById(R.id.back);
timerTextView = findViewById(R.id.timerTextView);
startButton = findViewById(R.id.startButton);

back.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
finish();
}
});

startButton.setOnClickListener(new View.OnClickListener() {
@Override
@@ -39,25 +59,67 @@ public void onClick(View v) {
}

private void startTimer() {
// 获取用户输入的时间
EditText editTextTime = findViewById(R.id.editTextTime);
int customTime = Integer.parseInt(editTextTime.getText().toString());
// 获取用户输入的时间和活动
action = findViewById(R.id.editAction);
editTextTime = findViewById(R.id.editTextTime);
categories = findViewById(R.id.categories);
String inputTime = editTextTime.getText().toString().trim();
String inputAction = action.getText().toString().trim();
String inputCategories = categories.getSelectedItem().toString();

//get calendar
calendar = Calendar.getInstance();
calendar.setTimeZone(TimeZone.getTimeZone("GMT+8:00"));
String year = String.valueOf(calendar.get(Calendar.YEAR));
String month = String.valueOf(calendar.get(Calendar.MONTH) + 1); // 注意月份是从0开始的,所以要加1
String day = String.valueOf(calendar.get(Calendar.DAY_OF_MONTH));


// 检查用户是否输入了时间和活动
if (!inputTime.isEmpty() && !inputAction.isEmpty() && !inputCategories.isEmpty()) {
int customTime = Integer.parseInt(inputTime);

// 实现计时逻辑,使用用户输入的时间
countDownTimer = new CountDownTimer(customTime * 60 * 1000, 1000) {
@Override
public void onTick(long millisUntilFinished) {
updateTimerText(millisUntilFinished);
}

// 实现计时逻辑,使用用户输入的时间
countDownTimer = new CountDownTimer(customTime * 60 * 1000, 1000) {
@Override
public void onTick(long millisUntilFinished) {
updateTimerText(millisUntilFinished);
}
@Override
public void onFinish() {
// 完成工作时钟,可以处理相应逻辑
UserRecord userRecord = new UserRecord();

@Override
public void onFinish() {
// 完成工作时钟,可以处理相应逻辑
}
}.start();
//将这些获取到的数据写入db UserRecord
userRecord.setCategory(inputCategories);
userRecord.setDuration(customTime);
userRecord.setActionDescription(inputAction);
userRecord.setYear(year);
userRecord.setMonth(month);
userRecord.setDay(day);

userRecord.save();

startButton.setText("Pause");
isTimerRunning = true;

}
}.start();

startButton.setText("Pause");
isTimerRunning = true;

// 将时钟和按钮设置为可见
timerTextView.setVisibility(View.VISIBLE);
}else if (inputCategories.isEmpty()) {
// 用户没有选择,可以显示一个提示
Toast.makeText(this, "Please select a action.", Toast.LENGTH_SHORT).show();
} else if (inputAction.isEmpty()) {
// 用户没有输入时间,可以显示一个提示
Toast.makeText(this, "Please enter a valid action.", Toast.LENGTH_SHORT).show();
} else {
// 用户没有输入活动,可以显示一个提示
Toast.makeText(this, "Please enter a valid time.", Toast.LENGTH_SHORT).show();
}
}


24 changes: 13 additions & 11 deletions app/src/main/res/layout/activity_tomato.xml
Original file line number Diff line number Diff line change
@@ -36,25 +36,27 @@

</RelativeLayout>

<TextView
android:id="@+id/timerTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="283dp"
android:text="25:00"
android:textSize="40sp"
tools:ignore="UnknownId" />

<!-- EditText 用于用户输入时间 -->

<Button
android:id="@+id/startButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/timerTextView"
android:layout_centerHorizontal="true"
android:layout_marginTop="20dp"
android:text="Start" />
android:text="Start"
/>

<TextView
android:id="@+id/timerTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="283dp"
android:text="25:00"
android:textSize="40sp"
android:visibility="invisible"/>

<EditText
android:id="@+id/editTextTime"