Compare commits

..

No commits in common. 'master' and 'master' have entirely different histories.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -0,0 +1,3 @@
# Default ignored files
/shelf/
/workspace.xml

@ -0,0 +1 @@
My Application

@ -7,15 +7,17 @@
<option name="testRunner" value="PLATFORM" />
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleJvm" value="1.8" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/CalendarView" />
<option value="$PROJECT_DIR$/Database" />
<option value="$PROJECT_DIR$/DataBase" />
<option value="$PROJECT_DIR$/app" />
</set>
</option>
<option name="resolveModulePerSourceSet" value="false" />
<option name="useQualifiedModuleNames" value="true" />
</GradleProjectSettings>
</option>
</component>

@ -11,11 +11,6 @@
<option name="name" value="JBoss Community repository" />
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
</remote-repository>
<remote-repository>
<option name="id" value="MavenRepo" />
<option name="name" value="MavenRepo" />
<option name="url" value="https://repo.maven.apache.org/maven2/" />
</remote-repository>
<remote-repository>
<option name="id" value="BintrayJCenter" />
<option name="name" value="BintrayJCenter" />

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
<option name="id" value="Android" />
</component>
</project>

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/../.." vcs="Git" />
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
</component>
</project>

@ -7,7 +7,7 @@ android {
buildToolsVersion "30.0.3"
defaultConfig {
minSdkVersion 17
minSdkVersion 29
targetSdkVersion 30
versionCode 1
versionName "1.0"
@ -31,9 +31,9 @@ android {
dependencies {
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'com.google.android.material:material:1.4.0'
implementation project(path: ':Database')
implementation 'com.google.android.material:material:1.3.0'
implementation project(path: ':DataBase')
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
}

@ -133,7 +133,7 @@ public class CalendarPager extends ViewPager {
/**
*
*
*a
* @return
*/
public int getTopMovableDistance() {

@ -15,7 +15,7 @@ import androidx.coordinatorlayout.widget.CoordinatorLayout;
import androidx.core.view.ViewCompat;
import androidx.recyclerview.widget.RecyclerView;
import com.diary.database.utils.ScheduleSQLUtils;
import com.showme.database.utils.ScheduleSQLUtils;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
@ -132,9 +132,9 @@ public class CalendarUtils {
if (date.equals(CalendarViewAdapter.loadSelectedDate())) {
date.setSelectState(State.DAY_SELECT);
}
if (ScheduleSQLUtils.isScheduleMarked(date.toString())) {
date.setMarkSchedule(true);
}
// if (ScheduleSQLUtils.isScheduleMarked(date.toString())) {
// date.setMarkSchedule(true);
// }
}
return dates;
}

@ -7,7 +7,7 @@ android {
buildToolsVersion "30.0.3"
defaultConfig {
minSdkVersion 17
minSdkVersion 29
targetSdkVersion 30
versionCode 1
versionName "1.0"
@ -30,9 +30,9 @@ android {
dependencies {
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.2.1'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
}

@ -1,4 +1,4 @@
package com.diary.database;
package com.showme.database;
import android.content.Context;
@ -21,6 +21,6 @@ public class ExampleInstrumentedTest {
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("com.diary.database.test", appContext.getPackageName());
assertEquals("com.showme.database.test", appContext.getPackageName());
}
}

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.diary.database">
package="com.showme.database">
</manifest>

@ -1,4 +1,4 @@
package com.diary.database.DatabaseHelper;
package com.showme.database.DatabaseHelper;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;

@ -1,4 +1,4 @@
package com.diary.database.DatabaseHelper;
package com.showme.database.DatabaseHelper;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;

@ -1,9 +1,7 @@
package com.diary.database;
package com.showme.database;
import android.database.sqlite.SQLiteDatabase;
import java.util.List;
public class MySQLiteDatabase {
public static SQLiteDatabase scheduleSQL;

@ -1,8 +1,8 @@
package com.diary.database.utils;
package com.showme.database.utils;
import android.database.sqlite.SQLiteDatabase;
import com.diary.database.MySQLiteDatabase;
import com.showme.database.MySQLiteDatabase;
public class CourseSQLUtils {
private static SQLiteDatabase courseSQL = MySQLiteDatabase.courseSQL;

@ -1,9 +1,9 @@
package com.diary.database.utils;
package com.showme.database.utils;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import com.diary.database.MySQLiteDatabase;
import com.showme.database.MySQLiteDatabase;
import java.util.ArrayList;
import java.util.List;

Binary file not shown.

@ -4,11 +4,11 @@ plugins {
android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
buildToolsVersion "30.0.2"
defaultConfig {
applicationId "com.diary.showme"
minSdkVersion 17
applicationId "com.showme.myapplication"
minSdkVersion 29
targetSdkVersion 30
versionCode 1
versionName "1.0"
@ -30,17 +30,12 @@ android {
dependencies {
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.2.1'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'cc.trity.floatingactionbutton:library:1.0.0'
implementation 'org.greenrobot:eventbus:3.0.0'
implementation 'com.chanven.lib:cptr:1.1.0'
implementation 'com.jakewharton:butterknife:8.0.1'
implementation project(path: ':Database')
implementation project(path: ':CalendarView')
annotationProcessor 'com.jakewharton:butterknife-compiler:8.0.1'
implementation project(path: ':DataBase')
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
}

@ -1,4 +1,4 @@
package com.diary.showme;
package com.showme.myapplication;
import android.content.Context;
@ -21,6 +21,6 @@ public class ExampleInstrumentedTest {
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("com.diary.showme", appContext.getPackageName());
assertEquals("com.showme.myapplication", appContext.getPackageName());
}
}

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.showme.myapplication">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.MyApplication">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>

@ -0,0 +1,115 @@
package com.showme.myapplication;
import androidx.appcompat.app.AppCompatActivity;
import android.annotation.SuppressLint;
import android.os.Bundle;
import android.util.DisplayMetrics;
import android.widget.TextView;
import com.idealist.calendarview.CalendarAttr;
import com.idealist.calendarview.CalendarDay;
import com.idealist.calendarview.CalendarPager;
import com.idealist.calendarview.CalendarUtils;
import com.idealist.calendarview.CalendarView;
import com.idealist.calendarview.CalendarViewAdapter;
import com.idealist.calendarview.State;
import com.idealist.calendarview.interf.OnSelectDateListener;
import java.util.TimeZone;
public class MainActivity extends AppCompatActivity {
private TextView tvMonth;
private TextView tvYear;
private CalendarDay currentDay;
private CalendarView currentView;
private CalendarPager pager;
private CalendarViewAdapter viewAdapter;
private CalendarAttr attr;
private OnSelectDateListener onSelectDateListener;
private CalendarView.OnCalendarClickListener clickListener;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
TimeZone.setDefault(TimeZone.getTimeZone("GMT+8"));
DisplayMetrics dm = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getRealMetrics(dm);
int height = dm.heightPixels;
State.setDefaultItemHeightFull((height - 42 - 3*State.DEFAULT_ITEM_HEIGHT) / 6);
initCalendar();
attr = new CalendarAttr();
attr.setCalendarType(State.VIEW_MONTH);
attr.setScrollLevel(State.LEVEL_MEDIUM);
initListener();
viewAdapter = new CalendarViewAdapter(this, attr, onSelectDateListener,
clickListener);
initPager();
}
private void initCalendar() {
tvMonth = findViewById(R.id.custom_month_view);
tvYear = findViewById(R.id.custom_year_view);
currentDay = CalendarUtils.getCurrDay();
updateCalendar();
}
private void initPager() {
pager = findViewById(R.id.custom_vp);
pager.setAttr(attr);
pager.setAdapter(viewAdapter);
pager.setmOnPageChangeListener(new CalendarPager.OnPageChangeListener() {
@Override
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
}
@Override
public void onPageSelected(int position) {
currentView = viewAdapter.getViews().get(position % 3);
currentDay = currentView.getSeedDay();
updateCalendar();
}
@Override
public void onPageScrollStateChanged(int state) {
}
});
}
private void initListener() {
onSelectDateListener = offset -> pager.selectOtherMonth(offset);
clickListener = new CalendarView.OnCalendarClickListener() {
@Override
public void OnClick(CalendarDay day) {
// updateSchedule(day);
}
@Override
public void OnLongClick(CalendarDay day) {
}
};
}
@SuppressLint("SetTextI18n")
private void updateCalendar() {
tvMonth.setText(currentDay.getMonth() + "");
tvYear.setText(currentDay.getYear() + "");
}
}

@ -8,7 +8,6 @@ import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.Manifest;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
@ -16,7 +15,6 @@ import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.graphics.Color;
import android.media.MediaPlayer;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.view.View;
@ -26,8 +24,6 @@ import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
import com.diary.showme.Course.AddCourseActivity;
import com.diary.showme.Course.CourseActivity;
import com.diary.showme.diary.bean.DiaryBean;
import com.diary.showme.diary.db.DiaryDatabaseHelper;
import com.diary.showme.diary.event.StartUpdateDiaryEvent;
@ -94,10 +90,6 @@ public class DiaryActivity extends AppCompatActivity implements View.OnClickList
private MediaPlayer mediaPlayer = new MediaPlayer();
private DiaryAdapter adapter;
private Integer i = 0;
/**
*
*/
@ -186,13 +178,10 @@ public class DiaryActivity extends AppCompatActivity implements View.OnClickList
private void initMediaPlayer() {
try {
Integer num_of_raw = 2;//歌曲的总数目
Uri uri=Uri.parse("android.resource://"+getPackageName()+"/raw/"+"music"+i);
mediaPlayer.reset();//重置音乐播放器
//加载多媒体文件
mediaPlayer=MediaPlayer.create(getApplicationContext(),uri);
File file = new File(Environment.getExternalStorageDirectory(), "music.mp3");
mediaPlayer.setDataSource(file.getPath());//指定音频文件路径
mediaPlayer.setLooping(true);//设置为循环播放
i = (i+1) % num_of_raw;
mediaPlayer.prepare();//初始化播放器MediaPlayer
} catch (Exception e) {
e.printStackTrace();
@ -201,12 +190,11 @@ public class DiaryActivity extends AppCompatActivity implements View.OnClickList
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
switch (requestCode) {
switch (requestCode){
case 1:
if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
if(grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED){
initMediaPlayer();
} else {
}else{
Toast.makeText(this, "拒绝权限,将无法使用程序。", Toast.LENGTH_LONG).show();
finish();
}
@ -239,8 +227,7 @@ public class DiaryActivity extends AppCompatActivity implements View.OnClickList
}
break;
case R.id.main_fab_enter_edit:
Intent intent = new Intent(DiaryActivity.this, CardActivity.class);
startActivity(intent);
AddDiaryActivity.startActivity(this);
break;
}
}

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 33 KiB

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 31 KiB

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 28 KiB

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 32 KiB

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

Before

Width:  |  Height:  |  Size: 120 KiB

After

Width:  |  Height:  |  Size: 120 KiB

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 39 KiB

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 54 KiB

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 29 KiB

Before

Width:  |  Height:  |  Size: 53 KiB

After

Width:  |  Height:  |  Size: 53 KiB

@ -67,55 +67,64 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/list_item"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="com.idealist.calendarview.RecyclerViewBehavior"/>
<!-- <androidx.recyclerview.widget.RecyclerView-->
<!-- android:id="@+id/list_item"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="match_parent"-->
<!-- app:layout_behavior="com.idealist.calendarview.RecyclerViewBehavior"/>-->
<cc.trity.floatingactionbutton.FloatingActionsMenu
android:id="@+id/right_labels"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
app:fab_expandDirection="up"
app:fab_colorNormal="#f0f01a"
app:fab_icon = "@drawable/ic_baseline_add_24"
app:fab_addButtonSize="mini"
>
<cc.trity.floatingactionbutton.FloatingActionButton
android:id="@+id/diary_entry"
android:layout_width="30dp"
android:layout_height="30dp"
android:background="@drawable/ic_baseline_add_24"
app:fab_size="normal"
app:fab_title="FAB 3"
app:fab_colorNormal="#09F7F7"
app:fab_icon="@drawable/diary"
/>
<cc.trity.floatingactionbutton.FloatingActionButton
android:id="@+id/add_schedule"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_gravity="bottom|start"
app:fab_size="normal"
app:fab_title="FAB 0"
app:fab_colorNormal="#e41c1c"
app:fab_icon="@drawable/schedule"
/>
<cc.trity.floatingactionbutton.FloatingActionButton
android:id="@+id/course_entry"
android:layout_width="50dp"
android:layout_height="50dp"
app:fab_colorNormal="#24d63c"
app:fab_size="normal"
app:fab_icon="@drawable/course"
/>
</cc.trity.floatingactionbutton.FloatingActionsMenu>
<!-- <cc.trity.floatingactionbutton.FloatingActionButton-->
<!-- android:id="@+id/add_schedule"-->
<!-- android:layout_width="40dp"-->
<!-- android:layout_height="40dp"-->
<!-- android:layout_gravity="bottom|start"-->
<!-- app:fab_size="mini"-->
<!-- app:fab_title="FAB 0"-->
<!-- app:fab_colorNormal="#e41c1c"-->
<!-- app:fab_icon="@drawable/schedule"-->
<!-- />-->
<!-- <cc.trity.floatingactionbutton.FloatingActionsMenu-->
<!-- android:id="@+id/right_labels"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_gravity="bottom|end"-->
<!-- app:fab_expandDirection="up"-->
<!-- app:fab_colorNormal="#f0f01a"-->
<!-- app:fab_icon = "@drawable/ic_baseline_add_24"-->
<!-- app:fab_addButtonSize="mini"-->
<!-- >-->
<!-- <cc.trity.floatingactionbutton.FloatingActionButton-->
<!-- android:id="@+id/diary_entry"-->
<!-- android:layout_width="30dp"-->
<!-- android:layout_height="30dp"-->
<!-- android:background="@drawable/ic_baseline_add_24"-->
<!-- app:fab_size="normal"-->
<!-- app:fab_title="FAB 3"-->
<!-- app:fab_colorNormal="#09F7F7"-->
<!-- app:fab_icon="@drawable/diary"-->
<!-- />-->
<!-- <cc.trity.floatingactionbutton.FloatingActionButton-->
<!-- android:id="@+id/course_entry"-->
<!-- android:layout_width="50dp"-->
<!-- android:layout_height="50dp"-->
<!-- app:fab_colorNormal="#24d63c"-->
<!-- app:fab_size="normal"-->
<!-- app:fab_icon="@drawable/course"-->
<!-- />-->
<!-- <cc.trity.floatingactionbutton.FloatingActionButton-->
<!-- android:id="@+id/zone_entry"-->
<!-- android:layout_width="50dp"-->
<!-- android:layout_height="50dp"-->
<!-- app:fab_colorNormal="#501161"-->
<!-- app:fab_size="normal"-->
<!-- app:fab_icon="@drawable/zone"-->
<!-- />-->
<!-- </cc.trity.floatingactionbutton.FloatingActionsMenu>-->
<!-- <com.google.android.material.floatingactionbutton.FloatingActionButton-->
<!-- android:id="@+id/addSchedule"-->
<!-- android:layout_width="wrap_content"-->

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save