Compare commits
No commits in common. 'master' and 'master' have entirely different histories.
@ -0,0 +1,3 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
@ -0,0 +1 @@
|
||||
My Application
|
@ -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>
|
@ -1,6 +1,5 @@
|
||||
package com.idealist.calendarview;
|
||||
|
||||
|
||||
public class CalendarAttr {
|
||||
|
||||
static int RecTop;
|
@ -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;
|
@ -1,4 +1,4 @@
|
||||
package com.diary.showme;
|
||||
package com.showme.database;
|
||||
|
||||
import org.junit.Test;
|
||||
|
@ -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() + "");
|
||||
}
|
||||
|
||||
}
|
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: 210 B After Width: | Height: | Size: 210 B |
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 |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 5.2 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 4.8 KiB |
Before Width: | Height: | Size: 7.3 KiB After Width: | Height: | Size: 7.3 KiB |
Before Width: | Height: | Size: 7.7 KiB After Width: | Height: | Size: 7.7 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |